Suppose $K$ is a compact metrizable space. Then $K$ embeds homeomorphically into $[0,1]^{\mathbb{N}}$. The following fact and its proof are extracted from 'Topics in Banach Space Theory.'

Suppose $K$ is a compact metrizable space. Then $K$ embeds
  homeomorphically into $[0,1]^{\mathbb{N}}$.

Proof: Since $K$ is compact, it is separable. Let $(s_n)$ be a countable dense set in $K$. Let $\rho$ be a metric on $K$ inducing its topology. Without loss of generality, we can assume that $0 \leq \rho \leq 1.$ Define 
$$\theta:K \rightarrow [0,1]^{\mathbb{N}}$$ 
by $\theta(x) = (\rho(x,s_n))$. The map $\theta$ is continuous. Furthermore, $\theta$ is injective since different $x$ and $y$ will give different $n$th coordinate of $\theta(x)$ and $\theta(y)$. Since $K$ is compact and $[0,1]^{\mathbb{N}}$ is Hausdorff, $\theta$ maps $K$ homeomorphically into its image.
Question: 
$(1)$ Why $\theta$ is continuous?  
It suffices to show that the map $f(x) = \rho(x,s_n)$ is continuous for each $n$. If $\lim_{m \rightarrow \infty}x_m=x$, then we have $|\rho(x_m,s_n) - \rho(x,s_n)| < d(x,x_m) <\varepsilon$, by triangle inequality.  
$(2)$ Why can we conclude the bolded sentence?

Let $\theta^{-1} : \theta(K) \to K$ be the inverse of $\theta$. Then $\theta^{-1}$ of $K$ is continuous if and only if $(\theta^{-1})^{-1}(F) = \theta(F)$ is closed for every closed set $F \subseteq K$. Closed subsets of compact spaces are compact. the continuous image of a compact set is compact, and compact subsets of Hausdorff spaces are closed. Therefore $\theta$ and $\theta^{-1}$ are both continuous. So $\theta : K \to \theta(K)$ is a homeomorphism.
