Assume that $K$ is a compact metric space. I know that using the Stone-Weierstrass theorem it can be proven that $C(K)$, the Banach space of all continuous functions defined on $K$, is separable.
However, I don't know how to prove that the space $\space C(K,K):=\{f:K \to K; \space f \text{ is continuous} \}$ endowed with the supremum metric is separable. Since $K$ doesn't have a linear structure, it doesn't even make sense to talk about density of polynomials or anything like that.
I will be grateful for any help.
For any space $X$ and any metric space $(Y,d)$ we obtain a metric $d^+$ on the set $C(X,Y;d)$ of continuous $d$-bounded functions $f : X \to Y$ by defining
$$d^+(f,g) = sup \{ d(f(x),g(x)) \mid x \in X \} .$$
If $X$ is compact, then as a set $C(X,Y;d) = Y^X$ = set of all continuous functions $f : X \to Y$ and it is well-known that the topology generated by $d^+$ is nothing else than the compact open topology on $Y^X$.
Now let $X,Y$ be compact metric spaces. We claim that $Y^X$ is separable.
It is well-known that $Y$ can be embedded into the space $s = \Pi_{i=1}^\infty \mathbb{R}_i$ where each $\mathbb{R}_i$ is a copy of the real line. Let $e : X \to s$ be such an embedding. Then $e_\ast : Y^X \to s^X, e_\ast(f) = e \circ f$ is an embedding. It is well-known that the spaces $s^X = (\Pi_{i=1}^\infty \mathbb{R}_i)^X$ and $\Pi_{i=1}^\infty (\mathbb{R}_i^X)$ are homeomorphic. But each $\mathbb{R}_i^X \approx \mathbb{R}^X = C(X)$ is separable, hence the countable infinite product $s^X$ is separable and the subspace $e_\ast(Y^X)$ is separable.