Let $T, S$ be two compact Hausdorff spaces, and $h: S \to T$ a continuous function. Let $U: C(T) \to C(S)$ be the composition operator $$(U f)(s)=f(h(s))$$.
i) Prove that $U$ is surjective if and only if $h$ is injective.
ii) Prove that $U$ is an injective if and only if $h$ is surjective.
For i, we have :
Suppose that $U$ is surjective. Let $s_{1} \cdot s_{2} \in S$ with $s_{1} \neq s_{2} .$ By the well known Urysohn lemma, it follows that there is an $f \in C(S)$ s. t. $0 \leqslant f(s) \leqslant 1 \forall s \in S,$ with $f\left(s_{1}\right)=1$ and $f\left(s_{2}\right)=0 .$ since $U$ is surjective there is a $\varphi \in C(T)$ s. t. $U(\varphi)=f$ from whence $1=f\left(s_{1}\right)=\varphi\left(h\left(s_{1}\right)\right)$ and $0=f\left(s_{2}\right)=\varphi\left(h\left(s_{2}\right)\right),$ thus $h\left(s_{1}\right) \neq h\left(s_{2}\right),$ i.e., $h$ is injective. Conversely, suppose that $h$ is injective. since $h$ is continuous and $S$ is compact. it follows that the co-restriction of $h$. i.e., $h: S \to h(S)$ is a homeomorphism . Let now $g \in C(S)$. Then the function $g \circ h^{-1}: h(S) \to \Bbb R$ is continuous. Now, by the Tietze extension theorem, it follows that there is an $f \in C(T)$ s. t. $f(t)=\left(g \circ h^{-1}\right)(t) \forall t \in h(S),$ and then $f(h(s))=g(s) \forall s \in S,$ i.e., $U(f)=g$
I think case ii is false, but I can't find counterexample .
Suppose that $h$ is not surjective. Pick $y \in T\setminus h(S)$. Note that $h(S)$ is compact and hence closed. By Urysohn's lemma there exists $f \in C(T)$ such that $f|_{h(S)} = 0$ and $f(y) =1$. Then $2f \in C(T)$ and $2f \ne f$ but $$U(2f) = U(f)$$ since $2f$ and $f$ coincide on $h(S)$. Hence $U$ is not injective.