$|G|=p^3$ non abelian $\Longrightarrow\gamma_2(G)\lneq Z(G)$ Let $G$ be a non abelian group of order $p^3$. Hence $c=2$ ($c$ is the nilpotence class of $G$). I'll write down some notation, in order to be clear.
Let $Z_0(G):=1$, $Z_1(G)=Z(G)$, $Z_{k+1}(G)$ defined as $\frac{Z_{k+1}(G)}{Z_{k}(G)}=Z\left(\frac G{Z_k(G)}\right)$ for $k\ge1$ be the upper central series.
Let $\gamma_1(G):=G$, $\gamma_2(G):=[\gamma_1(G),G]=[G,G]$ and $\gamma_{j+1}(G):=[\gamma_{j}(G),G]=\overbrace{[G,\dots,G]}^{j+1}$ for $j\ge 2$ be the lower central series.
Now we can see easily that finite $p$-groups are nilpotent. One can see that
$$1=Z_0(G)<Z_1(G)<\cdots<Z_c(G)=G$$
and
$$G=\gamma_1(G)>\gamma_2(G)>\cdots>\gamma_{c}(G)>\gamma_{c+1}(G)=1\;.$$
Moreover we know that
$$
\gamma_{i}(G)\le Z_{c-i+1}(G)\;\;,i=1,\dots,c+1\;.
$$
In particular we have $\gamma_c(G)\le Z(G)$. So in the case of $|G|=p^3$ we have $\gamma_2(G)=[G,G]\le Z(G)$. And till here it's all right.
My problem is that my teacher wrote the equality, i.e. $\gamma_2(G)=Z(G)$. But to me it's wrong: I can take a normal subgroup $H\unlhd G$, $|H|=p$; so it has index $p^2$ so the factor group $G/H$ is abelian hence $1<H<G$ is a central series for $G$, then $1<\gamma_2(G)\le H\le Z(G)\le G$ from which follows (from cardinality) that $\gamma_2(G)=H$, but it doesen't force $Z(G)$ to be equal to $H$.
So I tried in another way: I took $K\unlhd G$, $|K|=p^2$ and like before I have a central series $1<K<G$ from which $1<\gamma_2(G)\leq K\le Z(G)\le G$, that yelds to $Z(G)=K$. Since such a $K$ and such a $H$ do always exist (
see
A finite $p$-group has normal subgroup of index $p^2$
), I proved that in this case, it is not true that $\gamma_2(G)=Z(G)$; what is true is (in general) $\gamma_2(G)\le Z(G)$ and in this case $\gamma_2(G)<Z(G)$.
Am I right? Thank you all!

See the comment above by Geoff. If $Z(G)$ has order $p^2$, then $G/Z(G)$ would be cyclic and $G$ would be abelian, which is crazy since $G$ is not. Thus the only possibility is that $Z(G)$ has order $p$, and so $\gamma_2(G) = Z(G)$ follows.
There is also another way to see that $|Z(G)| = p^2$ cannot happen. In this case there exists some $x \not\in Z(G)$, and then $Z(G) < C_G(x)$ which implies that $C_G(x)$ has order $p^3$. But then $C_G(x) = G$ and $x \in Z(G)$, a contradiction.
