Q:

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$).

