Solution (source code)

= Solution

Use induction on the order of the finite <p-group>. The trivial group is nilpotent. For $G\ne1$, the permitted center theorem gives $Z=Z(G)\ne1$, so the <quotient group> $G/Z$ is a smaller <p-group>. By induction it has a <central series>
$$
1=\overline H_0\le\overline H_1\le\cdots\le\overline H_s=G/Z.
$$
Let $H_i$ be the inverse image of $\overline H_i$ under the quotient map, so $H_0=Z$ and $H_s=G$. Centrality in the quotient gives $[H_i,G]\le H_{i-1}$ for $i\ge1$: the image of every such <group commutator> lies in $\overline H_{i-1}$. Also $[Z,G]=1$. Therefore
$$
\boxed{1\le Z=H_0\le H_1\le\cdots\le H_s=G}
$$
is a <central series> of $G$. This proves \b[every finite p-group is nilpotent], including the case $Z=G$, when the quotient is trivial and the series is simply $1\le G$.