Lebesgue integral of the extended Cantor function Let $f: [0,1] \to [0,1]$ be the extended Cantor function, and let $C$ denote the Cantor set. 
That is: $f(x) = \sum_{n=1}^{\infty} \frac{b_n} {2^n}$ where $b_n \in \{0,1\}$ for $x \in C$ and $f(x) = \sup\{f(y) : y \in C, y \leq x\}$ for $x \in [0,1]\setminus C$, i.e. $f(x) = \sum_{n=1}^{\infty}\frac{2b_n}{3^n}$ for $x \in [0,1]\setminus C$. 

Show that the Lebesgue integral of $f$ on the set $[0,1]$ is $1/2$. 

A hint in the textbook is: note that $f$ is constant on each interval in the complement of $C$. 
Edit: I have seen a somewhat convincing proof that uses symmetry, but I’m trying to follow the technique suggested by the textbook instead. 
 A: Here is an argument along the lines requested by OP.
Because $C$ is a nullset,  $f$ is equal a.e. to
$$
\sum_{k=1}^\infty \sum_{j=1}^{2^{k-1}}\tfrac{2j-1}{2^k}\,1_{(b_{k,j}/3^k,(b_{k,j}+1)/3^k)},
$$
where the numbers $b_{k,j}$ are the left endpoints of the ternary intervals of length $3^{-k}$ that are removed in the $k^{\rm th}$ step. Then
\begin{align}
\int_{[0,1]}f\,dm&=\sum_{k=1}^\infty \sum_{j=1}^{2^{k-1}}\frac{2j-1}{2^k}\,\frac1{3^k}
=\sum_{k=1}^\infty \frac1{6^k}\sum_{j=1}^{2^{k-1}}{2j-1}\\ \ \\
&=\sum_{k=1}^\infty \frac1{6^k}\,\left( 2\frac{2^{k-1}(2^{k-1}+1)}2-{2^{k-1}}\right)\\ \ \\
&=\frac14\,\sum_{k=1}^\infty\frac{4^k}{6^k}=\frac14\,\sum_{k=1}^\infty\frac{2^k}{3^k}=\frac{2/3}{4(1-2/3)}\\ \ \\
&=\frac12.
\end{align}
A: There are a number of ways to do this. Consider a the Cantor-Lebesgue function $f:[0,1]\rightarrow[0,1]$. Note that the cantor set has zero Lebesgue measure, i,e $\lambda(C)=0$. Hence $\int\limits_{[0,1]}f(x)d\lambda = \int\limits_{[0,1]\setminus C}f(x)d\lambda$. Take $D=\left[0,1\right]\setminus C$ to be constituted of the intervals: $$\begin{align}I_{11} &= \left[\frac13,\frac23\right] &&&&& F_1&=I_{11} \\I_{12}&=\left[\frac19,\frac29\right],& I_{22}&=I_{11},&I_{23}&=\left[\frac79,\frac89\right] &F_2&=I_{12}\cup I_{23}
\\&&&&\vdots\end{align} $$
The construction of $F_i$ follows by taking union of all odd subscripts of $I_{ij}$, i.e. $F_i=\bigcup\limits_{j\in\mathcal{I_{i}}}I_{nj}$ where $\mathcal{I_i}=\left\{1,3,5,\cdots,2^i-1\right\}$. This construction is done so that $F_i$ is constituted of disjoint intervals of equal lengths of $\frac1{3^i}$, and also $\bigcup\limits_{n=1}^{\infty}F_n=D$.
Note that the Cantor-Lebesgue function is constant on these intervals $I_{ij}$. Hence the functions $g_i(x)=f(x)\mathbb{I}_{F_{i}}$ are $\mathcal{L}$-simple, i.e. $g_i(x)=\sum\limits_{j\in\mathcal{I}_i}c_{ij}\mathbb{I}_{I_{ij}}$ (Where $\mathbb{I}_E$ is the characteristic function of the set $E$.) It can observed that $c_{ij}=\frac j{2^i}$. Denote $f_n(x)=f(x)\mathbb{I}_{\bigcup\limits_{i=1}^nF_i}=\sum\limits_{i=1}^{n}g_i(x)$. Since $\bigcup\limits_{i=1}^nF_i\uparrow D$, it follows that $f_n\uparrow f$. And its simple to evaluate,
$$\begin{align}\int_Dg_i(x)d\lambda&=\sum_{j\in\mathcal{I}_i}c_{ij}\lambda(D\cap\mathbb{I}_{ij})=\frac1{6^i}\sum_{j\in\mathcal{I}_i}j=\frac14\left(\frac23\right)^i\\\int_Df_n(x)d\lambda&=\sum_{i=1}^{n}\int_Dg_i(x)d\lambda=\sum_{i=1}^n\frac14\left(\frac23\right)^i\end{align}$$
Thus we can apply monotone convergence theorem, to give
$$\begin{align}\int_Df(x)d\lambda&=\int_D\lim_{n\to\infty}f_n(x)d\lambda
\\&=\lim_{n\to\infty}\int_{D}f_n(x)d\lambda\\&=\sum_{i=1}^\infty\frac14\left(\frac23\right)^i = \frac12\end{align}$$ 
Which is a geometric series with common ratio $\frac23$ and the first term  is $\frac16$ hence the sum evaluates to $\frac12$.
note :$\uparrow$ denotes an increasing sequence. $A_n\uparrow B$ denotes that the increasing sequence of sets $\left\{A_n\right\}$ converges to $B$, and similarly for functions as well. 
