Examples of monotone functions where "number" of points of discontinuity is infinite We know that if $f:D(\subseteq \mathbb{R})\to\mathbb{R}$ be a monotone function and if $A$ be the set of points of discontinuity of $F$ then $\left\lvert A \right\rvert$ is countable. Where $\left\lvert A \right\rvert$ denotes the cardinality of $A$.
My question is, 

If $D=[a,b]$ then does there exist any function for which $\left\lvert A \right\rvert=\aleph_0$ ?


Actually the question arose when I attempted to prove that $\left\lvert A \right\rvert$ is countable. Let me briefly discuss the argument. 
Proof (certainly wrong in view of the comment below but can't find the flaw in the following argument)

Assume that $\left\lvert A \right\rvert$ is infinite. Then consider the quantity $$\displaystyle\lim_{x\to x_0+}f(x)-\displaystyle\lim_{x\to x_0-}f(x)$$for all $x_0\in A$. Now consider, $$B=\left\{\left\lvert\lim_{x\to x_0+}f(x)-\lim_{x\to x_0-}f(x)\right\rvert\mid x_0\in A\right\}$$Note that $B$ is bounded and $B\ne \emptyset$. So, $\sup B$ exists. Now define, $$\sup B\ge d_n> \dfrac{(n-1)\sup B}{n}$$ where $d_n\in B\setminus \{d_1,d_2,\ldots,d_{n-1}\}$
Then the series $\displaystyle\sum_{i=1}^\infty d_i$ diverges. 

My conclusion followed from this argument.
 A: Let me answer by first constructing a non-decreasing function $[0,1]\rightarrow[0,1]$ with a discontinuity at every point $2^{-n}$ for $n>0$. In particular, set $f(x)=1$ for every $x\in (\frac{1}2,1]$ and say $f(x)=\frac{f(2x)}2$ for every $x\in [0,1]$. This defines a function with infinitely many discontinuities with the following self-similar graph:
$\hskip1.5in$
One could also write this $f$ in closed form as $f(x)=2^{\lfloor\log_2(x)\rfloor}$. One could also consider the function $g(x)=f(x)+x$ if one desires a strictly increasing function with the same property.
Now, let us examine why your proof does not properly handle this case. The set $B$ is precisely:
$$B=\{2^{-n}:n>0\}\cup \{0\}$$
and satisfies
$$\sum_{b\in B}b=1$$
which immediately is a problem for your argument. Your argument correctly takes that there exists a $b\in B$ in any open interval around $\sup B$, but it incorrectly assumes these to be distinct. In this particular instance, $\sup B$ is the maximum of $B$ and is isolated from other points (rather than situation you seem to be imagining, where $\sup B$ is not in $B$, but rather is an accumulation point of $B$).
A: *

*Take the graphic of any function you like, which is both continuous and monotonous over a finite interval of your choice $[a,~b]$.

*Map said interval to $[0,1]$ using $x\mapsto\dfrac{x-a}{b-a}$.

*Divide the new interval $[0,1]$ into an infinite number of subintervals of the form $\bigg(\dfrac1{n+1},\dfrac1n\bigg]$.

*Let the graphic on $\bigg(\dfrac12,1\bigg]$ untouched, and move the graphic on $\bigg[0,\dfrac12\bigg]$ upwards by $\dfrac1{2^2}$, if the function is descending, or downwards by $\dfrac1{2^2}$, if it's ascending. 

*Similarly for $\bigg(\dfrac13,\dfrac12\bigg]$ and $\bigg[0,\dfrac13\bigg]$, leaving the former untouched, and translating the latter vertically by $\dfrac1{3^2}$, etc.

*I intentionally chose the quantum of translation $\dfrac1{n^2}$ instead of just $\dfrac1n$, because I wanted to avoid follow up questions of the form: But then the value in $0$ will tend towards $\pm\infty$, since the harmonic series diverges, thus rendering the length of the function's value domain infinite. How could we avoid that, so that both its definition domain and image domain are finite ?
Hope this helps!
