Let $X =\{0,1\}^{\Bbb N}$ and define $f: X \to \Bbb R, f(x) = 2 \sum_i^\infty3^{-i}x_i$. Show that $f$ is continuous. 
Let $X =\{0,1\}^{\Bbb N}$ and define  $f: X \to \Bbb R, f(x) = 2 \sum_i^\infty3^{-i}x_i$. Show that $f$ is continuous.

Since this is from a topological space $X$ to $\Bbb R$ I assume that for continuity the appropriate definitoin would be just $(\epsilon, \delta)$, instead of the topological one using preimages?
So $f$ is continuous if $d(x,y) < \delta \implies d(f(x),f(y)) < \varepsilon$ for all $\varepsilon >0 $.
Now I don’t know anything about the metric on $X$ (I assume this is the induced by the product topology), but $d(f(x),f(y)) = |f(x) -f(y)|$.
I get that $$| 2 \sum_i^\infty3^{-i}x_i -2 \sum_i^\infty3^{-i}y_i | = 2 |\sum_i^\infty3^{-i}(x_i-y_i) |$$
The term $\sum_i^\infty3^{-i}  \leqslant \frac12$ so $$2 |\sum_i^\infty3^{-i}(x_i-y_i) |  \leqslant 2|\frac12(x_i-y_i)| = |x_i-y_i|$$
But now I’m bit lost I’m not sure I can control this term?
 A: $D = \{0,1\}$ is a discrete space and $X$ is the countable infinite product of copies of $D$ which is endowed with the product topology. The set $\Sigma = \{ p_i^{-1}(U) \mid i \in \mathbb N, U \subset D \text{ open}\}$ is a subbasis of this topology. Here $p_i : X \to D$ denotes projection to the $i$-th factor. For $U = D$ we get $p_i^{-1}(U) = X$ and for $U = \emptyset$ we get $p_i^{-1}(U) = \emptyset$, thus the only nontrivial elements of $\Sigma$ are the sets $p_i^{-1}(\{x\})$ with $x = 0, 1$. A basis for the product topology is obtained by forming all finite intersections of nontrivial elements of $\Sigma$. In particular all sets
$$\{(x_1,\ldots,x_n)\} \times \prod_{i=n+1}^\infty D$$
with $(x_1,\ldots,x_n) \in \prod_{i=1}^n D$, $n$ arbitrary,  are open in $X$.
There is in fact a metric on $X$ inducing the product topology, but to show this would require an additional proof. So let us do it without this metric.
To prove that $f$ is continuous, consider $x = (x_i)_{ \in \mathbb N} \in X$. Let $V$ be an open neighborhood of $f(x)$ in $\mathbb R$. Choose $\epsilon > 0$ such that $(f(x) - \epsilon, f(x) + \epsilon) \subset V$. Next choose $n \in \mathbb N$ such that $\sum_{i=n+1}^\infty3^{-i} < \epsilon/2$. The set $W = \{(x_1,\ldots,x_n)\} \times \prod_{i=n+1}^n D$ is an open neighborhood of $x$ in $X$. For $y = (y_i)_{ \in \mathbb N} \in W$ we have $y_i - x_i = 0$ for $i \le n$ and $y_i - x_i \in \{-1,0,1\}$ for $i > n$. Thus
$$\lvert f(y) - f(x) \rvert = \lvert 2\sum_{i=1}^\infty y_i 3^{-i} -  2\sum_{i=1}^\infty x_i 3^{-i} \rvert = \lvert 2\sum_{i=1}^\infty (y_i-x_i) 3^{-i} \rvert = \lvert 2\sum_{i=n+1}^\infty (y_i-x_i) 3^{-i} \rvert \\ \le 2 \sum_{i=n+1}^\infty \lvert y_i - x_i \rvert3^{-i} \le \sum_{i=n+1}^\infty 3^{-i} < \epsilon .$$
Hence $f(y) \in (f(x) - \epsilon, f(x) + \epsilon) \subset V$.
A: Hint: $2 |\sum_i^\infty3^{-i}(x_i-y_i) |  \leqslant 2 |\sum_i^N3^{-i}(x_i-y_i) |+2 |\sum_N^\infty3^{-i} |$. Choose $N$ such that the second term is less than $\epsilon /2$.
