If $G$ isn't abelian and $|G|=p^{3}$ then $Z(G)=G'$ Let $G$ a finite group and $G' \subseteq G$ the smallest normal subgroup of $G$ such that $G/G'$ is abelian. Prove that if $G$ isn't abelian and $|G|=p^{3}$ then $Z(G)=G'$
My attempt:
If $G$ is not abelian, $Z(G) \neq G$. If $|G| = p^{3}$, then by Sylow there are subgroups of orders $p$ and $p^{2}$
I know the center of a p-group is also non-trivial. But would that imply that the smallest normal group is $Z(G)$? Why?
 A: Suppose $G$ is a nonabelian group of order $p^3$ for $p$ prime. 
Since $G$ is a $p$-group, $Z(G) > 1$; since $G$ is not abelian $Z(G) < G$. So $|Z(G)| = p$ or $p^2$. If $|Z(G)| = p^2$, then $G/Z(G)$ would be a cyclic group of order $p$ and thus implying $G$ is abelian. So we must have $|Z(G)| = p$; thus $G/Z(G)$ is a group of order $p^2$ and hence abelian (One should verify that for prime $p$ all groups of order $p^2$ are abelian.). Then $G' \subseteq Z(G)$ since $G'$ is smallest normal subgroup of $G$ whose quotient is abelian. Since $G$ is nonabelian, $G' > 1$ and this forces $G' = Z(G)$.
A: Hint: (1) If $G$ is non-abelian then $G/Z(G)$ is non-cyclic. (2) Every group of order $p^2$ is abelian. 
You already noted that the center should be non-trivial for your group.
A: Every group of order $p^2$ is abelian and the center is always normal. The hypothesis implies that $|Z(G)|=p$. Its quotient is therefore abelian and so $G'\subseteq Z(G)$. The other containment follows from minimality.
A: if $|Z(G)|=p^3$ then $G$ is a abelian group.It is contradiction.
if $|Z(G)|=p^2$ then $[G:Z(G)]=p$ thus $\frac{G}{Z(G)}$ is cyclic and  $G$ is a abelian group.It is contradiction.
Therefore  $|Z(G)|=p$
