Define the Cantor set $\mathcal{C}:=[0,1]\setminus\bigcup_{n=1}^{\infty}G_n$, where $G_1=(\frac{1}{3}, \frac{2}{3})$ and $G_n$ for $n>1$ is the union of the middle-third open intervals in the intervals of $[0, 1]\setminus (\bigcup_{j=1}^{n-1}G_j)$.
It is easy to see that $\mathcal{C}$ is also the set of numbers in $[0, 1]$ that have a base $3$ representation containing only $0$s and $2$s.
Define the Cantor function $\Lambda:[0,1]\to [0,1]$ as follows:
• If $x\in\mathcal{C}$, then $\Lambda(x)$ is computed from the unique base $3$ representation of $x$ containing only $0$s and $2$s by replacing each $2$ by $1$ and interpreting the resulting string as a base $2$ number.
• If $x\in [0,1]\setminus\mathcal{C}$, then $\Lambda(x)$ is computed from a base $3$ representation of $x$ by truncating after the first $1$, replacing each $2$ before the first $1$ by $1$, and interpreting the resulting string as a base $2$ number.
$\fbox{$\text{We want to compute }\int_{0}^{1}\Lambda(x).$}$
what follows is what I have come up with to find the value of this integral; it is not completely rigorous although it could be made rigorous by induction but I reckon it would be very lengthy so I would like to know: (a) if what I have done is correct and (b) if there is another (perhaps shorter) and more rigorous proof of this result, thanks
Since the Cantor set contains no interval with more than one element $\int_{\mathcal{C}}\Lambda=0$ so the only non-zero contribution to the value of the integral comes from the (constant) values that $\Lambda$ has on each middle-third open interval in $\bigcup_{n=1}^{\infty}G_n$. We have $$G_1 =(\frac{1}{3},\frac{2}{3}), G_2 =(\frac{1}{9},\frac{2}{9})\cup (\frac{7}{9},\frac{8}{9}), G_3 =(\frac{1}{27},\frac{2}{27})\cup (\frac{7}{27},\frac{8}{27})\cup (\frac{19}{27},\frac{20}{27})\cup (\frac{25}{27},\frac{26}{27}),$$ $$G_4 =(\frac{1}{81},\frac{2}{81})\cup (\frac{7}{81},\frac{8}{81})\cup (\frac{19}{81},\frac{20}{81})\cup (\frac{25}{81},\frac{26}{81})\cup (\frac{55}{81},\frac{56}{81})\cup (\frac{61}{81},\frac{62}{81})\cup (\frac{73}{81},\frac{74}{81})\cup (\frac{79}{81},\frac{80}{81})\dots$$
i.e. for each $n\geq 1$ we have $2^{n-1}$ disjoint open intervals, each of length $\frac{1}{3^n}$, which make up each $G_n$. The $G_n$s, in ternary expansion, look like: $$G_1 =(0.1,0.2), G_2 =(0.01,0.02)\cup (0.21,0.22),$$ $$ G_3 =(0.001,0.002)\cup (0.021,0.022)\cup (0.201,0.202)\cup (0.221,0.222),$$ $$G_4 =(0.0001,0.0002)\cup (0.0021,0.0022)\cup (0.0201,0.0202)\cup (0.0221,0.0222)\cup (0.2001,0.2002)\cup (0.2021,0.2022)\cup (0.2201,0.2202)\cup (0.2221,0.2222)\dots$$
and by identifying each open interval in each $G_n$ by its leftmost endpoint we have:
$$G_1\to 0.1,\ G_2\to 0.01, 0.21,\ G_3\to 0.001, 0.021, 0.201, 0.221,$$ $$G_4\to 0.0001, 0.0021, 0.0201, 0.0221, 0.2001, 0.2021, 0.2201, 0.2221,\dots$$ so we see that we can find (the ternary expansion) of the left endpoints of all the intervals in $G_{n+1}$ by taking those of $G_n$ and substituting $01$ or $21$ to the last digit so each interval generates two other intervals: one to the left of it (the $01$ one) and one to the right of it (the $21$ one).
So, $$\Lambda(G_1)=\{0.1_2\}=\{\frac{1}{2}\}, \Lambda(G_2)=\{0.01_2,0.11_2\}=\{\frac{1}{4},\frac{3}{4}\},$$ $$ \Lambda(G_3)=\{0.001_2,0.011_2,0.101_2,0.111_2\}=\{\frac{1}{8},\frac{3}{8},\frac{5}{8},\frac{7}{8}\},$$ $$\Lambda(G_4)=\{0.0001_2,0.0011_2,0.0101_2,0.0111_2,0.1001_2,0.1011_2,0.1101_2,0.1111_2\}=\{\frac{1}{16},\frac{3}{16},\frac{5}{16},\frac{7}{16},\frac{9}{16},\frac{11}{16},\frac{13}{16},\frac{15}{16}\},\dots$$ hence we have that $G_n=\{\frac{1}{2^n},\frac{3}{2^n},\dots,\frac{2^n-1}{2^n}\}$ so $$\int_{0}^{1}\Lambda=\int_{\bigcup_{n=1}^{\infty} G_n}\Lambda=\frac{1}{3}\cdot\frac{1}{2}+\frac{1}{9}(\frac{1}{4}+\frac{3}{4})+\frac{1}{27}(\frac{1}{8}+\frac{3}{8}+\frac{5}{8}+\frac{7}{8})+\frac{1}{81}(\frac{1}{16}+\frac{3}{16}+\frac{5}{16}+\frac{7}{16}+\frac{9}{16}+\frac{11}{16}+\frac{13}{16}+\frac{15}{16})+\dots +\frac{1}{3^n}(\frac{1}{2^n}+\dots+\frac{2^n-1}{2^n})=\frac{1}{6}+\frac{4}{36}+\frac{16}{216}+\frac{64}{1296}+\dots=\sum_{n=1}^{\infty}\frac{4^{n-1}}{6^n}=\frac{1}{4}\sum_{n=1}^{\infty}(\frac{4}{6})^n=\frac{1}{4}\sum_{n=1}^{\infty}(\frac{2}{3})^n=\frac{1}{4}\cdot\frac{\frac{2}{3}}{1-\frac{2}{3}}=\frac{1}{2}.$$