Extension to the Cantor function Prove that $g:C\rightarrow I=[0,1]$ uniquely extends to a continuous monotone increasing map $g:I\rightarrow I$, where $C=\{0,1\}^{\mathbb{N}}$ (;$\{0,1\}$ is equipped with the discrete topology) and $g(\{a_n\})=\sum_{i=1}^{\infty} \frac{a_i}{2^i}$.

I guess that the problem wants me to construct the Cantor function, but I don't have any clue to extend $C$ to $I$. Since usually we don't write like $C\subset I$ , it doesn't seem to make sense for me, even though $C$ is homeomorphic to the Cantor set, a subset of $I$.
Any help will be appreciated. 
 A: To say that a function $f_0$ extends another function $f$, the domain of $f$ must be contained within the domain of $f_0$, so we need some sort of embedding of $C$ into $I$ for the question to make sense.
I expect that it is intended that $C$ is embedded by $e: C \to I$ where $e(\{a_n\} ) = \sum_{i=1}^\infty \frac{2a_i}{3^i}$ and that we want to show that a monotone function $g_0:I\to I$, such that $g_0 \circ e = g,$ is unique.
To see this, let $x \in I \setminus e(C)$. Therefore, there is some least $n\in \mathbb{N}$ such that there is a $k$ with $0\leq k < 3^{n-1}$ and $x \in \left( \frac{3k + 1}{3^n}, \frac{3k + 1}{3^n} \right).$ Now, I claim that the trinary representation of $k$ is such that it contains no $1$'s, as if it did there would be a lesser $n$ that satisfies our condition. We may write $k/2 = \sum_{i=1}^{n-1} b_i 3^{n - 1 - i},$ where $b_i \in \{0, 1\}$, and then let $l = (b_1, b_2, \ldots, b_{n-1}, 0, 1, 1, 1, \ldots)$ and $r = (b_1, b_2, \ldots, b_{n-1}, 1, 0, 0, 0, \ldots)$.
I claim that $$ e(l) = \frac{3k + 1}{3^n} \quad \text{ and } \quad e(r) = \frac{3k + 2}{3^n}$$ and furthermore $$ g(l) = g(r) = \frac{1}{2^n} + \sum_{i=1}^{n-1} \frac{b_i}{2^i}.$$
Now, $e(l) < x < e(r)$, so $g_0\circ e(l) \leq g_0(x) \leq g_0\circ e(r)$ if $g_0$ is monotone, and so $g_0(x) = g(l) = g(r)$. Therefore, the value of $g_0(x)$ is unique for all $x \in I \backslash e(C).$
That's pretty ugly, but a fair bit of that is just getting around the embedding issue.
