Solution (source code)

= Solution

The identity belongs to the <center of a group>. If $z,w$ commute with every $g$, then $zw$ does too; rearranging $gz=zg$ also shows that $z^{-1}$ commutes with $g$. Hence $Z(G)$ is a <subgroup>. Moreover $gzg^{-1}=z$ for $z\in Z(G)$, so it is a <normal subgroup>.

Suppose $|G|=p^n>1$. The <conjugation action> partitions $G$ into <conjugacy classes>. The <orbit-stabilizer theorem> gives class size $[G:C_G(x)]$, where $C_G(x)$ is the <centralizer> of $x$. By <Lagrange's theorem>, this size is a power of $p$; it is one exactly when $x$ is central. Thus the <class equation> has the form
$$
|G|=|Z(G)|+\sum_{\text{noncentral classes}}p^{m_i},\qquad m_i\ge1.
$$
It follows that $p\mid |Z(G)|$. Since the identity is central, $|Z(G)|\ge1$, and therefore
$$
\boxed{|Z(G)|\ge p,\qquad Z(G)\ne\{e\}.}
$$
This is the nontrivial-centre property of a <finite p-group>.