Arrange rationals in a sequence $q_n$, and set $$f(x) = \sum_{n = 1}^\infty 2^{-n} \mathbb{1}_{[q_n,\infty)}(x),$$ where $$\mathbb{1}_{[q_n,\infty)}(x) = \begin{cases} 1 & \text{if $x \geqslant q_n$,} \\ 0 & \text{if $x < q_n$.} \end{cases} $$ In other words, $$f(x) = \sum_{n : q_n \leqslant x} 2^{-n} .$$ By the dominated convergence theorem, we have $$\lim_{x \to a^-} f(x) = \sum_{n : q_n < a} 2^{-n}$$ and $$\lim_{x \to a^+} f(x) = \sum_{n : q_n \leqslant a} 2^{-n} = f(a) .$$ It follows that $$\lim_{x \to q_n^+} f(x) = 2^{-n} + \lim_{x \to q_n^-} f(x)$$ and hence $f$ is discontinuoushas no limit at each $q_n$, but $f$ is continuous at every irrational point.
Arrange rationals in a sequence $q_n$, and set $$f(x) = \sum_{n = 1}^\infty 2^{-n} \mathbb{1}_{[q_n,\infty)}(x),$$ where $$\mathbb{1}_{[q_n,\infty)}(x) = \begin{cases} 1 & \text{if $x \geqslant q_n$,} \\ 0 & \text{if $x < q_n$.} \end{cases} $$ In other words, $$f(x) = \sum_{n : q_n \leqslant x} 2^{-n} .$$ By the dominated convergence theorem, we have $$\lim_{x \to a^-} f(x) = \sum_{n : q_n < a} 2^{-n}$$ and $$\lim_{x \to a^+} f(x) = \sum_{n : q_n \leqslant a} 2^{-n} = f(a) .$$ It follows that $f$ is discontinuous at each $q_n$, but $f$ is continuous at every irrational point.
Arrange rationals in a sequence $q_n$, and set $$f(x) = \sum_{n = 1}^\infty 2^{-n} \mathbb{1}_{[q_n,\infty)}(x),$$ where $$\mathbb{1}_{[q_n,\infty)}(x) = \begin{cases} 1 & \text{if $x \geqslant q_n$,} \\ 0 & \text{if $x < q_n$.} \end{cases} $$ In other words, $$f(x) = \sum_{n : q_n \leqslant x} 2^{-n} .$$ By the dominated convergence theorem, we have $$\lim_{x \to a^-} f(x) = \sum_{n : q_n < a} 2^{-n}$$ and $$\lim_{x \to a^+} f(x) = \sum_{n : q_n \leqslant a} 2^{-n} = f(a) .$$ It follows that $$\lim_{x \to q_n^+} f(x) = 2^{-n} + \lim_{x \to q_n^-} f(x)$$ and hence $f$ has no limit at each $q_n$, but $f$ is continuous at every irrational point.
Arrange rationals in a sequence $q_n$, and set $$f(x) = \sum_{n = 1}^\infty 2^{-n} \mathbb{1}_{[q_n,\infty)}(x),$$ where $$\mathbb{1}_{[q_n,\infty)}(x) = \begin{cases} 1 & \text{if $x \geqslant q_n$,} \\ 0 & \text{if $x < q_n$.} \end{cases} $$ In other words, $$f(x) = \sum_{n : q_n \leqslant x} 2^{-n} .$$ By the dominated convergence theorem, we have $$\lim_{x \to a^-} f(x) = \sum_{n : q_n < a} 2^{-n}$$ and $$\lim_{x \to a^+} f(x) = \sum_{n : q_n \leqslant a} 2^{-n} = f(a) .$$ It follows that $f$ is discontinuous at each $q_n$, but $f$ is continuous at every irrational point.