Prove that there exists a monotone nondecreasing function $f:[0,1] \rightarrow \mathbb{R}$ discontinuous in rationals of $[0,1]$
- I tried to test functions of the type $$ f(x)=\begin{cases} \frac{1}{q} & \text{if } x=\frac{p}{q} \mid p,q \in \mathbb{Z}^+ \,\,\, \text{and} \,\,\, \gcd(p,q)=1 \\ x & \text{if } x \not\in \mathbb{Q} \end{cases}$$ which is discontinuous in all rationals, but is not monotone.