functions between function spaces Let $X$ be a topological space and $C(X,\Bbb R)$ the space of continuous functions on $X$ with values in $\Bbb R$. Every continuous map $f:X\to Y$ induces a map $f^*:C(Y,\Bbb R)\to C(X,\Bbb R)$ by the formula $f^*(g)=g\big(f(x)\big)$, where $g:Y\to\Bbb R$ is in $C(Y,\Bbb R)$ and $x\in X$. Suppose now that both $X$ and $Y$ are compact Hausdorff. 
How can I prove that if $f^*$ is injective, then $f$ is surjective, and if $f^*$ is bijective, then $f$ is a homeomorphism?
Thanks for your help
 A: HINT: Suppose that $f$ is not surjective. Let $K=f[X]$; $K$ is compact, hence closed, and there is some $y_0\in Y\setminus K$. Thus, there is a $g\in C(Y,\Bbb R)$ such that $g(y_0)=1$, and $g(y)=0$ for $y\in K$. The constant function $z(y)=0$ for $y\in Y$ is also in $C(Y,\Bbb R)$. What can you say about $f^*(g)$ and $f^*(z)$?
Now suppose that $f^*$ is bijective. I’d begin by showing that $f$ is injective. If not, there are $x_0,x_1\in X$ such that $f(x_0)=f(x_1)=y_0$, say. There is an $h\in C(X,\Bbb R)$ such that $h(x_0)\ne h(x_1)$ (why?), and since $f^*$ is surjective, there is a $g\in C(Y,\Bbb R)$ such that $f^*(g)=h$. What can you say about $g(y_0)$?
Finally, you need to show that $f^{-1}$ is continuous (or, equivalently, that $f$ is open).
A: It is a well-known result that the maximal ideals of $C(X,\mathbb{R})$ correspond 1:1 to the points of $X$. The correspondence is given by mapping $x \in X$ to $\{f : f(x)=0\}$. It follows easily from this that $f \mapsto f^*$ establishes a bijection $\hom_{\mathsf{CHaus}}(Y,X) \to \hom_{\mathbb{C}-\mathsf{Alg}}(C(X),C(Y))$. In other words, $C : \mathsf{CHaus} \to \mathbb{C}-\mathsf{Alg}^{op}$ is fully faithful. In particular, if $f^*$ is an isomorphism, then the same is true for $f$. By the way, the Theorem by Gelfand-Naimark asserts that the essential image consists precisely of the commutative unital C*-algebras. Now, let us show


*

*$f$ is injective iff $f^*$ is surjective

*$f$ is surjective iff $f^*$ is injective


If $f : Y \to X$ is injective, then it is a homeomorphism onto a closed subspace of $X$, and Tietze's extension Theorem implies that $f^* : C(X) \to C(Y)$ is surjective. If, conversely, $f^*$ is surjective, let $y \neq y'$ in $Y$. By Urysohn's Lemma, there is some $g \in C(Y)$ with $g(y)=1$ and $g(y')=0$. Now use that $f^*$ is surjective to conclude $f(y) \neq f(y')$.
Now assume that $f : Y \to X$ is surjective. Then clearly $f^*$ is injective. Conversely, suppose that $f^*$ is injective. Let $K$ be the image of $f$. Then since $C(X) \to C(K) \to C(Y)$ is injective, also $C(X) \to C(K)$ is injective. But it is also surjective by the above. Hence $K \to X$ is an isomorphism, i.e. $f$ is surjective.
