Monotone real valued function which is discontinuous only at rationals. There are examples of real valued functions which are continuous at irrationals and discontinuous at rationals. But i am trying to find such a monotone function. I don't know how to think this types of examples. I wants such types of simple examples not too much complicated so that each and everyone can easily digest it. I tried many simple examples but did't got. In the book Counterexamples in Analysis by Bernard R. Gelbaum and John Meigs Hubbell Olmsted there is given a way to construct such types to examples, but i like simplest such types of example. Please try to give such type of example. Thanks in advance.

Let $\{r_n\}_{n= 1}^\infty$ be an enumeration of the rationals, and take
$$f(x) = \sum_{n=1}^\infty 2^{-n} u(x - r_n)$$
where $u$ is the unit step function ($u(x) = 0$ for $x < 0$, $1$ for $x > 0$).
