Here is the discussion of the Cantor-Lebesgue function in Sec. 2.7, in the book Real Analysis by H. L. Royden and P. M. Fitzpatrick, 4th edition:
We now define the Cantor-Lebesgue function, a continuous, increasing function $\varphi$ defined on $[0, 1]$ which has the remarkable property that, despite the fact that $\varphi(1) > \varphi(0)$, its derivative exists and is zero on a set of measure $1$. For each $k$, let $O_k$ be the union of the $2^k-1$ intervals which have been removed during the first $k$ stages of the Cantor deletion process. Thus $C_k = [0, 1] \setminus O_k$. Define $O = \bigcup_{k=1}^\infty O_k$. Then, by De Morgan's Identities, $C = [0, 1] \setminus O$. We begin by defining $\varphi$ on $O$ and then we define it on $C$.
Fix a natural number $k$. Define $\varphi$ on $O_k$ to be the increasing function on $O_k$ which is constant on each of its $2^k-1$ open intervals and takes the $2^k-1$ values $$ \left\{ 1/2^k, 2/2^k, 3/2^k, \ldots, \left( 2^k-1 \right)/ 2^k \right\}. $$ Thus, on the single interval removed at the first stage of the deletion process, the prescription for $\varphi$ is $$ \varphi(x) = 1/2 \ \mbox{ if } x \in (1/3, 2/3). $$ On the three intervals that are removed in the first two stages, the prescription for $\varphi$ is $$ \varphi (x) = \begin{cases} 1/4 & \mbox{ if } x \in (1/9, 2/9) \\ 2/4 & \mbox{ if } x \in (3/9, 6/9) = (1/3, 2/3) \\ 3/4 & \mbox{ if } x \in (7/9, 8/9) \end{cases} $$ We extend $\varphi$ to all of $[0, 1]$ by defining it on $C$ as follows: $$ \varphi(0) = 0 \ \mbox{ and }\ \varphi(x) = \sup \big\{ \varphi(t) \, | \, t \in O \cap [0, x) \big\} \ \mbox{ if } x \in C \setminus \{ 0 \}. $$
Now here is Proposition 20:
The Cantor-Lebesgue function $\varphi$ is an increasing continuous function that maps $[0, 1]$ onto $[0, 1]$. Its derivative exists on the open set $O$, the complement in $[0, 1]$ of the Cantor set, $$ \varphi^\prime = 0 \ \mbox{ on } O \ \mbox{ while } m(O) = 1. $$
I have issues with several of the points made in the proof of this proposition, which runs as follows:
Since $\varphi$ is increasing on $O$, its extension above to $[0, 1]$ also is increasing. [How does this hold? Of course, we need to show that $\varphi$ is non-decreasing throughout $[0, 1]$. So how to do it explicitly using our knowledge about the behavior of $\varphi$ on set $O$?] As for continuity, $\varphi$ certainly is continuous at each point in $O$ since for each such point belongs to an open interval on which it is constant. [This is obvious since when going from $O_k$ to $O_{k+1}$ we do not change the value of $\varphi$ on any open interval that is contained in both $O_k$ and $O_{k+1}$. So if $x_0 \in O = \bigcup_{k=1}^\infty O_k$, then $x_0 \in O_k$ for some natural number $k$, and so $x_0$ is in one of the $2^k-1$ open intervals of which $O_k$ is composed and over each one of these intervals $\varphi$ is constant, and then we also have $x_0 \in O_l$ for any natural number $l > k$ also. Can a better piece of reasoning be given to justify assertion made in the last sentence? ] Now consider a point $x_0 \in C$ with $x_0 \neq 0, 1$. Since the point $x_0$ belongs to $C$ it is not a member of the $2^k-1$ intervals removed in the first $k$ stages of the removal process, whose union we denote by $O_k$. Therefore, if $k$ is sufficiently large, $x_0$ lies between two consecutive intervals in $O_k$; choose $a_k$ in the lower of these and $b_k$ in the upper one. [What is the point of $k$ being sufficiently large? After all, $x_0 \in C = [0, 1] \setminus O = [0, 1] \setminus \bigcup_{k=1}^\infty O_k$, and so $x_0 \not\in O_k$ for any natural number $k$.] The function $\varphi$ was defined to increase by $1/2^k$ across two consecutive intervals in $O_k$. Therefore $$ a_k < x_0 < b_k \ \mbox{ and } \varphi \left( b_k \right) - \varphi \left( a_k \right) = 1/2^k. $$ Since $k$ may be arbitrarily large, the function $\varphi$ fails to have a jump discontinuity at $x_0$. For an increasing function, a jump discontinuity is the only possible type of discontinuity. Therefore $\varphi$ is continuous at $x_0$. If $x_0$ is an endpoint of $[0, 1]$, a similar argument establishes continuity at $x_0$. [How to explicitly give the required argument?]
Since $\varphi$ is constant on each of the intervals removed at any stage of the removal process, its derivative exists and equals $0$ at each point in $O$. Since $C$ has measure zero, its complement in $[0, 1]$, $O$, has measure $1$. Finally, since $\varphi(0) = 0$ and $\varphi(1) = 1$ [How is $\varphi(1) = 1$?] and $\varphi$ is increasing and continuous, we infer from the Intermediate Value Theorem that $\varphi$ maps $[0, 1]$ onto $[0, 1]$.
Thus concludes the proof!
I would appreciate if the learned Math Stack Exchange community would be kind enough to fill in the details where I've gotten stuck as fully and explicitly as possible.