Non-trivial nilpotent group has non-trivial center

Suppose $\;\gamma_n=1\;$ but $\;\gamma_{n-1}\neq 1\;$ (according to my definition, the correct one, and thus $\;G\;$ is of class $\;n\;$), then

$$\gamma_n:=[\gamma_{n-1},G]=1\iff \forall\,x\in\gamma_{n-1}\;\;and\;\;\forall\,g\in G\;,\;\;x^{-1}g^{-1}xg=1\iff xg=gx\implies$$

$$\implies \gamma_{n-1}\le Z(G)\implies Z(G)\neq 1$$


In case of finite groups: one can prove that finite nilpotent groups are precisely those groups that are a (internal) direct product of their Sylow subgroups: $G \cong P_1 \times \dots \times P_n$. Hence looking at the centers: $Z(G) \cong Z(P_1) \times \dots \times Z(P_n)$ and it is well-known that centers of $p$-groups are non-trivial.