If $X$ and $Y$ are compact Hausdorff spaces, show that for any algebra homomorphism $$ F:C(Y) \to C(X) $$ there exists a continuous function $f:X\to Y$ such that $$ F(\phi)=\phi \circ f, \forall \phi \in C(Y) $$
The spaces are compact Hausdorff, so presumably one should use the Gelfand-Naimark theorem and construct a continuous function from the spectra of $C(X)$ and $C(Y)$. To be honest I'm pretty confused. I don't know exactly what I should try to do; using characters and spectra instead of points in spaces doesn't seem to get me closer to the answer. Any help would be appreciated.
Please note that this is not homework.
EDIT: I've found the solution.
Proof. Let $A=C(X)$ and $B=C(Y)$ be two commutative algebras over $\mathbb{R}$. If $X$ and $Y$ are compact Hausdorff spaces, show that for any algebra homomorphism $$ F:B \to A $$ there exists a continuous function $f:X\to Y$ such that $$ F(\phi)=\phi \circ f, \forall \phi \in C(Y) $$ We first define all the relevant maps. Let $X_A$ and $Y_B$ be the spectra of $A$ and $B$ respectively. Let $\sigma: Y_B \to Y$ and $\tau: X_A \to X$ be the homeomorphisms induced by the Gelfand Naimark theorem, since $X$ and $Y$ are compact Hausdorff. Let $\lambda: A \to \mathbb{R}$ and $\chi: B\to \mathbb{R}$ be two characters in $X_A$ and $Y_B$ respectively. Notice that $\lambda \circ F$ is a function from $B \to \mathbb{R}$ that lies in $Y_B$ since $F$ respects the $\mathbb{R}$-linearity and multiplicative identities of the algebra structure on $\mathbb{B}$ and $\lambda$ is a character and therefore respects the same identities by definition. So there exists an injective function $h: X_A \to Y_B$.
We prove that $h$ is continuous. Apply Exercise 4: we have that $ f_a \circ h = f_a(h(\lambda))= f_a(\lambda \circ F)=\lambda(F(a))= g_{F(a)}$ with $g_a: X_A \to \mathbb{R}$ and $g_a(\lambda)=\lambda(a)$ and $f_a: Y_B \to \mathbb{R}$ and $f_a(\chi)=\chi(a)$.
Define $f$ as follows: $f(x):= (\sigma \circ h \circ \tau)(x)$. The composition of continuous function is continuous so f is continuous.
We now prove the identity $\phi \circ f=F(\phi)$. \begin{align*} (\phi \circ f)(x)&= (\phi \circ \tau \circ h \circ \sigma)(x) \\ &= (\phi \circ \tau\circ h) (\chi_x)\\ &= (\phi \circ \tau \circ \chi_x \circ F)\\ &= (\phi \circ \tau \circ \chi_y)\\ &=\phi(y)\\ &= \chi_y(\phi)\\ &=(\chi_x \circ F)(\phi)\\ &=F(\phi)(x) \end{align*}