TITLE: Looking for an example of an increasing function $f:[a,b] \to [a,b]$ which is discontinuous at infinitely many points
QUESTION [5 upvotes]: I am looking for an example of an increasing    function $f:[a,b] \to [a,b]$ which is discontinuous at infinitely many points ; please help , thanks in advance .

REPLY [2 votes]: Select infinitely many points in $[a,b].$ For example, $a,a+\frac {b-a}{2},a+\frac {b-a}{2}+\frac {b-a}{2^2},\cdots.$ Define $f$ to be a line segment in each of the intervals $[a+\frac {b-a}{2}+\cdots \frac {b-a}{2^n},a+\frac {b-a}{2}+\cdots \frac {b-a}{2^n}+ \frac {b-a}{2^{n+1}})$. For example, $f(x)$ increases from $ 1$ to $1+\frac {1}{2}$ in the first interval , from $1+\frac{1}{2}+\frac{1}{2^2}$ to $1+\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}$ in the second, etc. Then each of the end points of these subintervals $a+\frac {b-a}{2}+\cdots \frac {b-a}{2^n}$ is a point of discontinuity