Given a continuous function $f: \mathbb R \to \mathbb R$ with
- $f[\mathbb R] \subseteq [0,1]$.
- $f(t+2) = f(t)$ for all $t \in \mathbb R$,
- $f(t) = 0$ for $0\le t \le \frac{1}{3}$, and
- $f(t)=1$ for $\frac{2}{3} \le t \le 1$,
which is used to define functions $x(t)=\sum_{n=1}^{\infty} 2^{-n} f(3^{2 n-1} t)$ and $y(t)=\sum_{n=1}^{\infty} 2^{-n} f(3^{2 n} t)$, I am supposed to prove as an exercise that $g: t \mapsto (x(t),y(t))$ is continuous and surjective from $[0,1]$ to $[0,1]^2$.
I can prove continuity of $x$ and $y$ (hence of $g$) with the Weierstrass $M$-test, but I'm struggling to say something meaningful about the surjectivity. In fact, I find it difficult to even evaluate $g$ except for some convenient values of $t$ (such as $t = 0,1,\frac{1}{3},\frac{1}{9}$), let alone performing the opposite task of finding a $t$ for a given point in $[0,1]^2$. Can someone point me in the right direction?
Given $u$ and $v$, write them in their base two expansion $$ u = \sum_{n=1}^\infty \frac{u_n}{2^n}, \quad v = \sum_{n=1}^\infty \frac{v_n}{2^n} ,$$ where $u_n$, $v_n$ are 0 or 1. Form a base three number $$ t = \sum_{n=1}^\infty \frac{2u_n}{3^{2n}} + \frac{2v_n}{3^{2n+1}} .$$ Then $$ 3^{2m-1} t \pmod 2 = \frac{2u_n}{3} + \frac{2v_n}{3^2} + \sum_{n=m+1}^\infty \frac{2u_n}{3^{2(n-m)+1}} + \frac{2v_n}{3^{2(n-m)+2}} ,$$ and $$ 0 \le \frac{2v_n}{3^2} + \sum_{n=m+1}^\infty \frac{2u_n}{3^{2(n-m)+1}} + \frac{2v_n}{3^{2(n-m)+2}} \le \sum_{n=2}^\infty \frac{2}{3^n} \le\frac13 .$$ Thus $f(3^{2m-1} t) = u_n$. Similarly $f(3^{2m} t) = v_n$. Thus $x(t) = u$ and $y(t) = v$.