Consider the functor $C$ from the category of compact Hausdorff spaces to that of unital abelian C*-algebras given by $C: X \mapsto C(X, \mathbb{C})$ (the continuous maps from $X$ to $\mathbb{C}$) and also, for continuous $f: X \to Y$ ($Y$ being another compact Hausdorff space), $Cf: C(Y) \to C(X), h \mapsto h \circ f$. If $Cf$ is injective, it is then the case that $f$ is surjective -- my question is how/why? Several resources that I have found brush this off by merely invoking Tietze - and then moving on. However, I don't see how this works, exactly. Clearly I'm overlooking something elementary. Here is as far as I get with my reasoning.
First off, $X$ is a compact Hausdorff space and is hence normal. Moreover, $f(X)$ is a closed (and compact) subset of $Y$. If $Cf$ is injective, then we have that for $h_1,h_2 \in C(Y)$, if $h_1|_{f(X)} = h_2|_{f(X)}$ then it must be that $h_1 = h_2$.
I suppose a slight variant of Tietze's theorem is being considered, where in the real and imaginary parts of the function are being extended, however, I see no value in extending $h_1|_{f(X)}$ and $h_2|_{f(X)}$ to all of $Y$, for they would have to be identically $h_1$ and $h_2$ respectively, which are equal!
What should be done?