Solution (source code)

= Solution

The identity commutes with every group element, so it lies in the <center of a group>. If $z,w$ are central and $g\in G$, then $gw=wg$ implies $gw^{-1}=w^{-1}g$. Consequently
$$
g(zw^{-1})=zg w^{-1}=zw^{-1}g.
$$
Thus $zw^{-1}$ is central. The <subgroup test> proves
$$
\boxed{Z(G)\leq G.}
$$
Equivalently, the centre is nonempty, closed under products, and closed under inverses. This proof does not require finiteness. In fact the centre is an <Abelian subgroup>, and it is normal because $gzg^{-1}=z$ for each central element.