[proofplan]
We construct an explicit isomorphism between $\operatorname{Gal}(M/K)$ and the inverse limit $\varprojlim_{L/K \in I} \operatorname{Gal}(L/K)$ by sending $\sigma \mapsto (\sigma|_L)_{L/K \in I}$. Injectivity follows from the fact that $M = \bigcup_{L \in I} L$ (every element of $M$ lies in some finite Galois subextension), so an automorphism that restricts to the identity on every $L$ is itself the identity. Surjectivity follows from the observation that a compatible family of restrictions defines an automorphism of $M$ by acting on each element via the appropriate finite subextension. We then verify that the map is a homeomorphism by showing it maps the basis of open sets $\operatorname{Gal}(M/L)$ for the Krull topology to the corresponding basis of the product topology.
[/proofplan]
[step:Define the restriction map and verify it is a well-defined group homomorphism]
Let $I$ denote the directed set of finite Galois subextensions $L/K$ of $M/K$, ordered by inclusion. For $L \subseteq L'$ in $I$, the restriction map
\begin{align*}
\operatorname{res}_{L'/L} \colon \operatorname{Gal}(L'/K) &\to \operatorname{Gal}(L/K) \\
\sigma &\mapsto \sigma|_L
\end{align*}
is a well-defined surjective group homomorphism (surjectivity holds because $L/K$ is Galois: every $K$-automorphism of $L$ extends to $L'$ by the isomorphism extension theorem, but more precisely, the restriction of any element of $\operatorname{Gal}(L'/K)$ to $L$ lies in $\operatorname{Gal}(L/K)$ because $L/K$ is normal). The system $(\operatorname{Gal}(L/K), \operatorname{res}_{L'/L})$ is an inverse system of finite groups.
Define the map
\begin{align*}
\Phi \colon \operatorname{Gal}(M/K) &\to \varprojlim_{L/K \in I} \operatorname{Gal}(L/K) \\
\sigma &\mapsto (\sigma|_L)_{L/K \in I}.
\end{align*}
This is well-defined: for $L \subseteq L'$, we have $(\sigma|_{L'})|_L = \sigma|_L$, so the family $(\sigma|_L)$ is compatible with the transition maps. It is a group homomorphism because $(\sigma \tau)|_L = (\sigma|_L)(\tau|_L)$ for each $L$.
[/step]
[step:Prove injectivity using $M = \bigcup_{L \in I} L$]
Suppose $\Phi(\sigma) = \Phi(\tau)$, i.e., $\sigma|_L = \tau|_L$ for every finite Galois subextension $L/K$ of $M/K$. Let $x \in M$. Since $M/K$ is Galois, $M$ is the union of its finite Galois subextensions: there exists $L/K \in I$ with $x \in L$ (take, for instance, the normal closure over $K$ of $K(x)$, which is a finite Galois extension of $K$ contained in $M$). Then $\sigma(x) = \sigma|_L(x) = \tau|_L(x) = \tau(x)$.
Since $x \in M$ was arbitrary, $\sigma = \tau$. Therefore $\Phi$ is injective.
[/step]
[step:Prove surjectivity by constructing an automorphism from a compatible family]
Let $(\sigma_L)_{L \in I} \in \varprojlim_{L/K \in I} \operatorname{Gal}(L/K)$ be a compatible family, i.e., for $L \subseteq L'$ we have $\sigma_{L'}|_L = \sigma_L$.
Define $\sigma \colon M \to M$ as follows: for $x \in M$, choose any $L/K \in I$ with $x \in L$ and set $\sigma(x) = \sigma_L(x)$. This is well-defined: if $x \in L$ and $x \in L'$ for two finite Galois subextensions, then $x \in L \cap L'$. Since $I$ is directed, there exists $L'' \in I$ with $L, L' \subseteq L''$. By compatibility, $\sigma_{L''}|_L = \sigma_L$ and $\sigma_{L''}|_{L'} = \sigma_{L'}$, so $\sigma_L(x) = \sigma_{L''}(x) = \sigma_{L'}(x)$.
The map $\sigma$ is a field automorphism of $M$ fixing $K$: for $x, y \in M$, choose $L \in I$ containing both $x$ and $y$. Then $\sigma(x + y) = \sigma_L(x + y) = \sigma_L(x) + \sigma_L(y) = \sigma(x) + \sigma(y)$, and similarly for multiplication. For $a \in K$, $\sigma(a) = \sigma_L(a) = a$ since $\sigma_L \in \operatorname{Gal}(L/K)$. Therefore $\sigma \in \operatorname{Gal}(M/K)$.
By construction, $\sigma|_L = \sigma_L$ for each $L \in I$, so $\Phi(\sigma) = (\sigma_L)_{L \in I}$. Hence $\Phi$ is surjective.
[guided]
The key subtlety in the surjectivity argument is well-definedness. Given $x \in M$, the element $x$ may lie in many different finite Galois subextensions $L/K$. We need to show that $\sigma_L(x)$ is independent of the choice of $L$.
The directed system structure is essential here. Two finite Galois subextensions $L, L'$ of $M/K$ may not be comparable by inclusion, so we cannot directly use the compatibility condition $\sigma_{L'}|_L = \sigma_L$ (which only applies when $L \subseteq L'$). Instead, we use the fact that $I$ is *directed*: for any $L, L' \in I$, the composite $LL'$ (the field generated by $L$ and $L'$ inside $M$) is again a finite Galois extension of $K$ (a composite of Galois extensions is Galois), so there exists $L'' = LL' \in I$ with $L, L' \subseteq L''$. Now compatibility gives $\sigma_L(x) = \sigma_{L''}(x) = \sigma_{L'}(x)$.
Once well-definedness is established, verifying that $\sigma$ is a field automorphism is routine: the field operations $+$ and $\times$ on $M$ restrict to the field operations on any finite subextension $L$, and $\sigma_L$ preserves them.
[/guided]
[/step]
[step:Verify $\Phi$ is a homeomorphism with respect to the Krull topology and the profinite topology]
The Krull topology on $\operatorname{Gal}(M/K)$ has as a basis of open neighbourhoods of the identity the subgroups $\operatorname{Gal}(M/L)$ for $L/K \in I$. The profinite topology on $\varprojlim \operatorname{Gal}(L/K)$ (as a subspace of $\prod_{L \in I} \operatorname{Gal}(L/K)$ with the product of discrete topologies) has as a basis of open neighbourhoods of the identity the subgroups $\ker(\pi_L)$, where $\pi_L$ is the projection to $\operatorname{Gal}(L/K)$.
We claim $\Phi(\operatorname{Gal}(M/L)) = \ker(\pi_L) \cap \operatorname{im}(\Phi)$ for each $L \in I$. Indeed, $\sigma \in \operatorname{Gal}(M/L)$ if and only if $\sigma|_L = \operatorname{id}_L$ if and only if $\pi_L(\Phi(\sigma)) = \operatorname{id}$, i.e., $\Phi(\sigma) \in \ker(\pi_L)$. Since $\Phi$ is a bijection (by the previous steps), this shows $\Phi$ maps the basis of the Krull topology bijectively onto the basis of the subspace topology on $\operatorname{im}(\Phi) = \varprojlim \operatorname{Gal}(L/K)$.
Therefore $\Phi$ is continuous and open. Since $\Phi$ is also a bijection, it is a homeomorphism.
Both $\operatorname{Gal}(M/K)$ (with the Krull topology) and $\varprojlim \operatorname{Gal}(L/K)$ (with the profinite topology) are compact Hausdorff: the inverse limit of finite discrete groups with the product topology is compact by Tychonoff's theorem and Hausdorff because it is a subspace of a product of Hausdorff (in fact discrete) spaces. The Krull topology on $\operatorname{Gal}(M/K)$ is compact and Hausdorff by the same token (it is defined to make $\Phi$ an isomorphism of topological groups). So $\Phi$ is an isomorphism of topological groups.
[/step]