$O(G)=p^2 $, $p$ prime, $|Z(G)|>1$; prove $G$ abelian We know that $Z(G)<G,\;$  then $O(Z(G)) \mid  O(G). $
If $\;O(Z(G))= p^2, $ then $\;Z(G)=G$ and we are done.
Now, if $O(Z(G))= p,\,$ how can I prove that $G$ is abelian ?
Is it by proving that $G/Z(G)$ is cyclic? And if so, then $G$ is abelian.
If yes how to prove that that  $G/Z(G)$ is cyclic?
 A: Prove the following (easy):
Lemma: For any  group $\;G\;$, the quotient group $\;G/Z(G)\;$ cannot be cyclic non-trivial.
From the above it follows that $\;G/Z(G)\;$ cyclic $\;\implies G\;$ is abelian.
A: $o(Z(G))=p$ then $o(G/Z(G))=p$ and every group of prime order is cyclic
A: First note that $Z(G)$ is non-trivial, by the class equation. Hence $Z(G)$ has order $p$ or $p^2$. If $O(Z(G))=p^2$, $Z(G)=G$ and we're done.
If $O(Z(G))=p$, then $Z(G)$ is cyclic, generated by, say, $z$. G/$Z(G)$ also has order p, and hence is cyclic, generated by, say $a$. Now let $g,g'$ two elements of $G$. These can be written as $g=a^n z$, $g'=a^{n'}z',\enspace z,z'\in Z(G)$. Then
\begin{align*}gg'&=(a^nz)(a^{n'}z')=a^na^{n'}z'z&&\text{since $z\in Z(G)$}\\
&=a^{n'}a^nz'z=a^{n'}z'a^nz=g'g.&&\text{since $z'\in Z(G)$}\end{align*}
Thus $G$ is abelian in that case too.
A: : Let P be a group of order $p^2$
. We know  that every p−group has
non-trivial, so the center $Z(P)$ of $P$ is not trivial.Thus $|Z(P)|$ is either $p$ or $p^2$.In
the latter case, we have $P = Z(P)$, so P is abelian. In the former case, $P/Z(P) $is
a group of order p. We know that groups of prime order p are cyclic, so $P/Z(P)$ is
cyclic. P is abelian so $ Z(P) = P,$ a contradiction
A: Z(G) is always subgroup of group G therefore by Sylow's first theorem the possibility for 
$o(Z(G))=1 \ or \ p \ or \ p^2$ but p groups have nontrivial center thus,$o(Z(G))= p \ or \ 
p^2$ if $o(Z(G))=o(G)$ then G is Abelian(can you prove this?).
Now, Using this lemma if $o(Z(G))=p$
$\;G/Z(G)=\;$ cyclic $\;\implies G\;$ is Abelian.
$\;o(G/Z(G))=p\;$ hence it is cyclic implies that G is Abelian. 
