How wild can regulated functions be? A regulated $f$: $[a, b]\longrightarrow\mathbb{R}$ has countably many points of discontinuity. Can the set $D$ of discontinuities be dense in $[a, b]$? What's an example? 
In fact, can we find such an $f$ for any prescribed countable set $D\subseteq [a, b]$ of discontinuities?

Let $D \subset [0,1]$ be any countable set. Then, as in here, write
$$D = \{r_1, r_2, \cdots, r_n, \cdots\}$$
and 
$$f(x) = \sum_{ r_n <x} \frac{1}{2^n}.$$
One can check that this is regulated and discontinuous precisely at $D$. 
