[proofplan]
We prove directly that $C_G(g)$ is a subgroup of $G$. First we show that it is nonempty by checking that the identity element commutes with $g$. Then we show closure under the group operation and under inverses: if two elements commute with $g$, then so does their product, and if an element commutes with $g$, then so does its inverse. These three facts establish that $C_G(g)$ is a subgroup of $G$.
[/proofplan]
[step:Show that the identity element belongs to the centraliser]
Let $e \in G$ denote the identity element of the group $G$. By the identity law in $G$,
\begin{align*}
e \cdot g = g = g \cdot e.
\end{align*}
Hence $e \cdot g = g \cdot e$, so $e \in C_G(g)$. Therefore $C_G(g)$ is nonempty.
[/step]
[step:Verify closure of the centraliser under the group operation]
Let $a,b \in C_G(g)$. By the definition of $C_G(g)$, the elements $a$ and $b$ commute with $g$, so
\begin{align*}
a \cdot g &= g \cdot a, &
b \cdot g &= g \cdot b.
\end{align*}
Using associativity in $G$ and these two commutation relations, we compute
\begin{align*}
(a \cdot b)\cdot g
&= a \cdot (b \cdot g) \\
&= a \cdot (g \cdot b) \\
&= (a \cdot g)\cdot b \\
&= (g \cdot a)\cdot b \\
&= g \cdot (a \cdot b).
\end{align*}
Thus $a \cdot b$ commutes with $g$, and since $a \cdot b \in G$ by closure of the group operation, we have $a \cdot b \in C_G(g)$.
[guided]
We want to prove that the centraliser is closed under multiplication. That means we begin with two arbitrary elements of the centraliser and prove that their product is still in the centraliser.
Let $a,b \in C_G(g)$. By definition, membership in $C_G(g)$ means commuting with the fixed element $g$. Therefore
\begin{align*}
a \cdot g &= g \cdot a, &
b \cdot g &= g \cdot b.
\end{align*}
The goal is to prove $a \cdot b \in C_G(g)$, which means proving
\begin{align*}
(a \cdot b)\cdot g = g \cdot (a \cdot b).
\end{align*}
Starting from the left-hand side, associativity lets us move parentheses without changing the order of the elements:
\begin{align*}
(a \cdot b)\cdot g = a \cdot (b \cdot g).
\end{align*}
Now use the fact that $b$ commutes with $g$:
\begin{align*}
a \cdot (b \cdot g) = a \cdot (g \cdot b).
\end{align*}
Apply associativity again:
\begin{align*}
a \cdot (g \cdot b) = (a \cdot g)\cdot b.
\end{align*}
Now use the fact that $a$ commutes with $g$:
\begin{align*}
(a \cdot g)\cdot b = (g \cdot a)\cdot b.
\end{align*}
Finally, associativity gives
\begin{align*}
(g \cdot a)\cdot b = g \cdot (a \cdot b).
\end{align*}
Combining these equalities,
\begin{align*}
(a \cdot b)\cdot g = g \cdot (a \cdot b).
\end{align*}
Thus $a \cdot b$ commutes with $g$. Since $G$ is a group, $a \cdot b \in G$, so $a \cdot b \in C_G(g)$.
[/guided]
[/step]
[step:Verify closure of the centraliser under inverses]
Let $a \in C_G(g)$. Then $a \cdot g = g \cdot a$. Since $a \in G$ and $G$ is a group, the inverse $a^{-1} \in G$ exists. Starting from $a \cdot g = g \cdot a$, multiply on the left by $a^{-1}$ and on the right by $a^{-1}$ to obtain
\begin{align*}
a^{-1}\cdot(a \cdot g)\cdot a^{-1}
&= a^{-1}\cdot(g \cdot a)\cdot a^{-1}.
\end{align*}
Using associativity and the inverse law, this becomes
\begin{align*}
g \cdot a^{-1} = a^{-1}\cdot g.
\end{align*}
Therefore $a^{-1}\cdot g = g \cdot a^{-1}$, so $a^{-1}$ commutes with $g$. Hence $a^{-1} \in C_G(g)$.
[/step]
[step:Conclude that the centraliser is a subgroup of $G$]
We have shown that $C_G(g)$ is nonempty, closed under the group operation inherited from $G$, and closed under taking inverses in $G$. Therefore $C_G(g)$ is a subgroup of $G$, that is,
\begin{align*}
C_G(g) \le G.
\end{align*}
This proves the theorem.
[/step]