[proofplan]
The easy direction $(\Leftarrow)$ pulls back continuous functions along the homeomorphism, giving a unital algebra isometry. The substantive direction $(\Rightarrow)$ recovers the homeomorphism from the isometry $T : C(K) \to C(L)$ via the action of the adjoint $T^*$ on the extreme points of the dual unit balls. The structural ingredient is the characterisation of extreme points of $B_{C(K)^*}$ (over $\mathbb{C}$) as scaled point evaluations $\lambda \delta_k$ with $|\lambda| = 1$ and $k \in K$. Isometric isomorphisms map extreme points of unit balls to extreme points; hence $T^*(\delta_l) = \lambda(l) \delta_{\varphi(l)}$ defines functions $\lambda : L \to S^1$ and $\varphi : L \to K$. Continuity of $\lambda$ is established by evaluating $T^*\delta_l$ on the constant function $\mathbb{1}_K$, and continuity of $\varphi$ follows from weak*-continuity of $T^*$ together with the embedding $l \mapsto \delta_l$. The same analysis of $T^{-1}$ gives an inverse $\psi : K \to L$, completing the homeomorphism.
[/proofplan]
[step:Prove the easy direction: a homeomorphism gives an isometric isomorphism]
Suppose $\varphi : K \to L$ is a homeomorphism. Define the pullback map
\begin{align*}
\varphi^* : C(L) &\to C(K) \\
f &\mapsto f \circ \varphi.
\end{align*}
*Well-defined:* if $f \in C(L)$, then $f \circ \varphi : K \to \mathbb{C}$ is continuous (composition of continuous maps), so $f \circ \varphi \in C(K)$.
*Linear:* $(\varphi^*(af + bg))(k) = (af + bg)(\varphi(k)) = a f(\varphi(k)) + b g(\varphi(k)) = a (\varphi^* f)(k) + b (\varphi^* g)(k)$ for all $k \in K$, $a, b \in \mathbb{C}$, $f, g \in C(L)$.
*Multiplicative and unital:* $\varphi^*(fg) = (fg) \circ \varphi = (f \circ \varphi)(g \circ \varphi) = (\varphi^* f)(\varphi^* g)$, and $\varphi^*(\mathbb{1}_L) = \mathbb{1}_L \circ \varphi = \mathbb{1}_K$.
*Bijective:* the inverse is $(\varphi^{-1})^* : C(K) \to C(L)$, given by $g \mapsto g \circ \varphi^{-1}$. Indeed $\varphi^* \circ (\varphi^{-1})^* = (\varphi^{-1} \circ \varphi)^* = \operatorname{id}_{C(L)}$ and $(\varphi^{-1})^* \circ \varphi^* = (\varphi \circ \varphi^{-1})^* = \operatorname{id}_{C(K)}$.
*Isometric:* for $f \in C(L)$,
\begin{align*}
\|\varphi^* f\|_\infty = \sup_{k \in K} |f(\varphi(k))| = \sup_{l \in \varphi(K)} |f(l)| = \sup_{l \in L} |f(l)| = \|f\|_\infty,
\end{align*}
where the third equality uses surjectivity of $\varphi$.
Thus $\varphi^* : C(L) \to C(K)$ is an isometric isomorphism, giving $C(K) \cong C(L)$.
[/step]
[step:Set up the adjoint $T^*$ for the converse direction]
Suppose $T : C(K) \to C(L)$ is an isometric isomorphism. The adjoint
\begin{align*}
T^* : C(L)^* &\to C(K)^* \\
\mu &\mapsto \mu \circ T
\end{align*}
is a bounded linear operator with $\|T^*\| = \|T\| = 1$. Similarly $(T^{-1})^*$ has norm $\|T^{-1}\| = 1$. The identity $T \circ T^{-1} = \operatorname{id}_{C(L)}$ yields $(T^{-1})^* \circ T^* = (T \circ T^{-1})^* = \operatorname{id}_{C(L)^*}$, and analogously the other composition. Hence $T^*$ is invertible with $(T^*)^{-1} = (T^{-1})^*$, and $T^*$ is an isometric isomorphism between $C(L)^*$ and $C(K)^*$.
In particular,
\begin{align*}
T^*(B_{C(L)^*}) = B_{C(K)^*}.
\end{align*}
(For $\subseteq$: if $\|\mu\|_{C(L)^*} \leq 1$ then $\|T^*\mu\|_{C(K)^*} \leq \|T^*\| \|\mu\| \leq 1$. For $\supseteq$: apply the same argument to $(T^*)^{-1}$.)
[/step]
[step:Show isometric isomorphisms map extreme points of unit balls to extreme points]
We claim $T^*$ restricts to a bijection $\operatorname{Ext}(B_{C(L)^*}) \to \operatorname{Ext}(B_{C(K)^*})$.
Let $\mu \in \operatorname{Ext}(B_{C(L)^*})$. Suppose $T^*\mu = (1 - t)\nu_1 + t\nu_2$ with $t \in (0, 1)$ and $\nu_1, \nu_2 \in B_{C(K)^*}$. Apply the bounded inverse $(T^*)^{-1}$ (linear and norm-preserving by Step 2):
\begin{align*}
\mu = (T^*)^{-1}(T^*\mu) = (1 - t)(T^*)^{-1}\nu_1 + t (T^*)^{-1}\nu_2.
\end{align*}
Since $(T^*)^{-1}$ is an isometry and $\|\nu_i\| \leq 1$, we have $\|(T^*)^{-1}\nu_i\| = \|\nu_i\| \leq 1$, so $(T^*)^{-1}\nu_1, (T^*)^{-1}\nu_2 \in B_{C(L)^*}$.
By extremality of $\mu$ in $B_{C(L)^*}$, $(T^*)^{-1}\nu_1 = (T^*)^{-1}\nu_2$, hence $\nu_1 = \nu_2$. Therefore $T^*\mu \in \operatorname{Ext}(B_{C(K)^*})$.
The same argument applied to $(T^*)^{-1}$ shows $(T^*)^{-1}$ maps extreme points to extreme points. Combined with $T^* \circ (T^*)^{-1} = \operatorname{id}$, this proves the bijection
\begin{align*}
T^*(\operatorname{Ext}(B_{C(L)^*})) = \operatorname{Ext}(B_{C(K)^*}).
\end{align*}
[/step]
[step:Use the structure of extreme points of $B_{C(K)^*}$ to define $\lambda$ and $\varphi$]
The extreme points of the dual unit ball of $C(K)$ for $K$ compact Hausdorff are precisely the scaled point-evaluation functionals:
\begin{align*}
\operatorname{Ext}(B_{C(K)^*}) = \{\lambda \delta_k : k \in K, \lambda \in \mathbb{C}, |\lambda| = 1\},
\end{align*}
where $\delta_k(f) := f(k)$ for $f \in C(K)$. (This is a standard structural result from Chapter 2; we invoke it as a known fact.)
Applying this to $L$: for each $l \in L$, $\delta_l \in \operatorname{Ext}(B_{C(L)^*})$. By Step 3, $T^*(\delta_l) \in \operatorname{Ext}(B_{C(K)^*})$, so by the structural result there exist (unique up to the relation $\lambda \delta_k = \lambda' \delta_{k'} \iff k = k', \lambda = \lambda'$, since the $\delta_k$ are linearly independent) a unimodular scalar $\lambda(l) \in \mathbb{C}$ with $|\lambda(l)| = 1$ and a point $\varphi(l) \in K$ such that
\begin{align*}
T^*(\delta_l) = \lambda(l) \delta_{\varphi(l)}.
\end{align*}
This defines functions
\begin{align*}
\lambda : L &\to S^1 := \{z \in \mathbb{C} : |z| = 1\}, \\
\varphi : L &\to K.
\end{align*}
[/step]
[step:Prove $\lambda \in C(L)$ and identify it as $T(\mathbb{1}_K)$]
Apply the functional $T^*(\delta_l)$ to the constant function $\mathbb{1}_K \in C(K)$:
\begin{align*}
T^*(\delta_l)(\mathbb{1}_K) = \delta_l(T(\mathbb{1}_K)) = T(\mathbb{1}_K)(l).
\end{align*}
On the other hand, by Step 4,
\begin{align*}
T^*(\delta_l)(\mathbb{1}_K) = \lambda(l) \delta_{\varphi(l)}(\mathbb{1}_K) = \lambda(l) \cdot \mathbb{1}_K(\varphi(l)) = \lambda(l) \cdot 1 = \lambda(l).
\end{align*}
Equating:
\begin{align*}
\lambda(l) = T(\mathbb{1}_K)(l) \quad \text{for all } l \in L.
\end{align*}
Hence $\lambda = T(\mathbb{1}_K) \in C(L)$, so $\lambda : L \to S^1$ is continuous (as a map to $\mathbb{C}$, with image in $S^1$).
[/step]
[step:Prove $\varphi : L \to K$ is continuous via weak*-continuity of $T^*$]
The map $T^* : C(L)^* \to C(K)^*$ is weak*-to-weak* continuous: if $\mu_\alpha \to \mu$ in $w^*$ on $C(L)^*$ — i.e.\ $\mu_\alpha(g) \to \mu(g)$ for every $g \in C(L)$ — then for every $f \in C(K)$,
\begin{align*}
(T^*\mu_\alpha)(f) = \mu_\alpha(Tf) \to \mu(Tf) = (T^*\mu)(f),
\end{align*}
which is weak*-convergence on $C(K)^*$.
The map
\begin{align*}
\iota_L : L &\to (B_{C(L)^*}, w^*) \\
l &\mapsto \delta_l
\end{align*}
is a homeomorphism onto its image. *Continuity:* for $g \in C(L)$, the map $l \mapsto \delta_l(g) = g(l)$ is continuous (since $g \in C(L)$); by the universal property of the weak* topology, $l \mapsto \delta_l$ is continuous. *Injectivity:* if $\delta_l = \delta_{l'}$, then $g(l) = g(l')$ for all $g \in C(L)$; by Urysohn's Lemma (which applies in compact Hausdorff $L$), continuous functions separate points of $L$, so $l = l'$. *Closed image and homeomorphism:* $\iota_L(L)$ is the continuous image of the compact $L$ in the Hausdorff space $(C(L)^*, w^*)$, hence compact and closed; the continuous bijection $L \to \iota_L(L)$ from compact to Hausdorff is automatically a homeomorphism.
Analogously, $\iota_K : K \to (B_{C(K)^*}, w^*)$, $k \mapsto \delta_k$, is a homeomorphism onto its image.
Now we relate $l \mapsto \delta_{\varphi(l)}$ to a weak*-continuous expression. From Step 4, $T^*(\delta_l) = \lambda(l) \delta_{\varphi(l)}$. Since $|\lambda(l)| = 1$, multiplication by $\overline{\lambda(l)}$ inverts $\lambda(l)$:
\begin{align*}
\delta_{\varphi(l)} = \overline{\lambda(l)} \cdot T^*(\delta_l).
\end{align*}
The map $l \mapsto T^*(\delta_l)$ is continuous from $L$ to $(C(K)^*, w^*)$: it is the composition $L \xrightarrow{\iota_L} (C(L)^*, w^*) \xrightarrow{T^*} (C(K)^*, w^*)$, both of which are continuous. The map $l \mapsto \overline{\lambda(l)}$ is continuous (Step 5). The scalar multiplication map $\mathbb{C} \times C(K)^* \to C(K)^*$, $(z, \mu) \mapsto z \mu$, is jointly continuous in the weak* topology: if $z_\alpha \to z$ in $\mathbb{C}$ and $\mu_\alpha \to \mu$ in $w^*$, then for each $f \in C(K)$,
\begin{align*}
(z_\alpha \mu_\alpha)(f) = z_\alpha \mu_\alpha(f) \to z \mu(f) = (z\mu)(f),
\end{align*}
using continuity of multiplication on $\mathbb{C}$ and boundedness of $\mu_\alpha$ (norms uniformly bounded by $\|T^*\| = 1$, justifying interchange of limits).
Hence $l \mapsto \overline{\lambda(l)} \cdot T^*(\delta_l) = \delta_{\varphi(l)}$ is continuous from $L$ to $(C(K)^*, w^*)$.
Since $\iota_K : K \to \iota_K(K) \subseteq (C(K)^*, w^*)$ is a homeomorphism, the map $\varphi = \iota_K^{-1} \circ (l \mapsto \delta_{\varphi(l)})$ is continuous from $L$ to $K$.
[guided]
The strategy is to transfer the weak*-continuity of $T^*$ through the homeomorphisms $\iota_K, \iota_L$ to recover continuity of $\varphi$.
*Why $T^*$ is weak*-continuous.* The weak* topology on $C(L)^*$ is the initial topology induced by the evaluation maps $\{g \mapsto \mu(g) : g \in C(L)\}$ for $\mu \in C(L)^*$. To check $T^*$ is $w^*$-to-$w^*$ continuous, we verify that for each $f \in C(K)$, the composition $\mu \mapsto (T^*\mu)(f) = \mu(Tf)$ is $w^*$-continuous on $C(L)^*$. This is just the weak*-continuity of the evaluation at $Tf \in C(L)$, which is precisely a defining seminorm of $w^*$ on $C(L)^*$. So $T^*$ is $w^*$-to-$w^*$ continuous.
*Why $\iota_L$ is a homeomorphism onto its image.* Continuity by the universal property of $w^*$. Injectivity by Urysohn's Lemma (continuous functions separate points of compact Hausdorff). Closed-image and automatic-homeomorphism by compact-to-Hausdorff bijections.
*Why scalar multiplication on $C(K)^*$ is jointly weak*-continuous on bounded sets.* Pointwise: $(z\mu)(f) = z \cdot \mu(f)$. Joint continuity in $z$ and $\mu$ follows from continuity of multiplication in $\mathbb{C}$, given the uniform bound $\|\mu_\alpha\| \leq 1$ that holds in our setting.
*Recovering $\varphi$.* From $T^*(\delta_l) = \lambda(l) \delta_{\varphi(l)}$ and $|\lambda(l)| = 1$, divide through by $\lambda(l)$ to get $\delta_{\varphi(l)} = \overline{\lambda(l)} T^*(\delta_l)$. The right-hand side is continuous in $l$ (composition of continuous operations). The left-hand side is $\iota_K \circ \varphi$. Composing with $\iota_K^{-1}$ (which is continuous since $\iota_K$ is a homeomorphism onto its image), we get $\varphi$ continuous.
[/guided]
[/step]
[step:Apply the same construction to $T^{-1}$ to obtain a continuous inverse]
Apply Steps 2-6 with $T$ replaced by $T^{-1} : C(L) \to C(K)$ — also an isometric isomorphism, with adjoint $(T^{-1})^* = (T^*)^{-1} : C(K)^* \to C(L)^*$.
The same construction produces continuous functions $\mu : K \to S^1$ and $\psi : K \to L$ with
\begin{align*}
(T^*)^{-1}(\delta_k) = \mu(k) \delta_{\psi(k)}, \quad \mu(k) = T^{-1}(\mathbb{1}_L)(k).
\end{align*}
[/step]
[step:Verify $\psi \circ \varphi = \operatorname{id}_L$ and $\varphi \circ \psi = \operatorname{id}_K$]
We compute $(T^*)^{-1}(T^*(\delta_l))$ in two ways. First, $(T^*)^{-1} T^* = \operatorname{id}_{C(L)^*}$, so it equals $\delta_l$. Second, by Step 4, $T^*(\delta_l) = \lambda(l) \delta_{\varphi(l)}$, and applying $(T^*)^{-1}$ (linear):
\begin{align*}
(T^*)^{-1}(\lambda(l) \delta_{\varphi(l)}) = \lambda(l) (T^*)^{-1}(\delta_{\varphi(l)}) = \lambda(l) \mu(\varphi(l)) \delta_{\psi(\varphi(l))}.
\end{align*}
Equating:
\begin{align*}
\delta_l = \lambda(l) \mu(\varphi(l)) \delta_{\psi(\varphi(l))}.
\end{align*}
Since $\delta_{l'}$ are linearly independent across $l' \in L$ (any equation $a \delta_{l_1} = b \delta_{l_2}$ tested on a separating function forces $l_1 = l_2$ or $a = b = 0$), and $|\lambda(l) \mu(\varphi(l))| = 1 \cdot 1 = 1 \neq 0$, we conclude
\begin{align*}
\psi(\varphi(l)) = l \quad \text{and} \quad \lambda(l) \mu(\varphi(l)) = 1.
\end{align*}
The first equation gives $\psi \circ \varphi = \operatorname{id}_L$.
By symmetry — applying the same argument with $T$ and $T^{-1}$ swapped — we get $\varphi \circ \psi = \operatorname{id}_K$.
[/step]
[step:Conclude that $\varphi$ is a homeomorphism]
By Step 6, $\varphi : L \to K$ is continuous. By Step 7, $\psi : K \to L$ is continuous. By Step 8, $\psi \circ \varphi = \operatorname{id}_L$ and $\varphi \circ \psi = \operatorname{id}_K$. Therefore $\varphi$ is a continuous bijection with continuous inverse $\psi$, i.e.\ $\varphi$ is a homeomorphism between $L$ and $K$.
This completes the proof of the converse direction $C(K) \cong C(L) \implies K$ and $L$ homeomorphic, and combined with Step 1, the full Banach-Stone theorem.
[/step]