If $G$ is a nilpotent group of class $2$, show $G' ≤ Z(G)$, and here we are taking the definition that class of nilpotency is the smallest length of the central series of $G$; where $G'$ is the derived group of $G$.
Now I have $1=G_0 \lhd G_1 \lhd G=G_2$ which is central so, $G/G_1 < Z(G/G_1)$ so $G/G_1$ is abelian. Then we have $G' \leq G_1$.
So we have $1=G_0 \lhd G' \lhd G_1 \lhd G=G_2$ but we don't know whether this is a central series or not!! So what to do next?
Sorry here I can't comment with this reputation, so any kind of short comment could not help me. Could you give me the answer with explanation?