Construct a monotone function which has countably many discontinuities
The construction is correct. I’ll use your example as an illustration. Let $\{q_n:n\in\omega\}$ be an enumeration of $\mathbb{Q}\cap [0,1]$, and let $f(x)=\sum\limits_{q_n<x}2^{-n}$ for $x\in [0,1]$.
First consider what happens at some $q_m$: $$\lim\limits_{x\to {q_m}^-}f(x) = \sum_{q_n<q_m}2^{-n}=f(q_m),$$ because as $x$ moves up towards $q_m$, $\{q_n:q_n<x\}$ includes more and more of the rationals less than $q_m$. Thus, $f$ is continuous from the left at $q_m$, but for every $x>q_m$ we have $$f(x)=\sum_{q_n<x}2^{-n} \ge \sum_{q_n\le q_m}2^{-n} = f(q_m)+2^{-m},$$ so $f$ jumps by at least $2^{-m}$ at $q_m$. In fact $$\lim_{x\to {q_m}^+}f(x) = f(q_m)+2^{-m},$$ and the jump is exactly $2^{-m}$.
At each irrational $a \in [0,1]$, however, $f$ is easily seen to be continuous: $$\lim_{x\to a^-}f(x) = \lim_{x\to a^+}f(x) = \sum_{q_n<x}2^{-n}=f(x).$$