In a group of order $pq^2$, if p divides $|Z(G)|$, then G is abelian I want to prove that in a group of order $pq^2$, if $p$ divides $|Z(G)|$, then $G$ is abelian.
I know that in this case, the order of $G/Z(G)$ must be $q^2$.
If $G/Z(G)\simeq \mathbb{Z}/{q^2}\mathbb{Z}$, then we are done, because $\mathbb{Z}/{q^2}\mathbb{Z}$ is cyclic.
But what happens if $G/Z(G)\simeq \mathbb{Z}/{q}\mathbb{Z}\times \mathbb{Z}/{q}\mathbb{Z}$? I think I'm missing something trivial..
 A: You do not know that $G/Z(G)$ must have order $q^2$. In fact you are try to prove $G$ is abelian, which implies $Z(G) = G$ so you are actually trying to show $G/Z(G)$ has order $1$.
Note that since $p$ divides $|Z(G)|$, a sylow $p$, $S_p$ is central. Thus $1 \to S_p \to G \to G/S_p \to1$ is a short exact sequence with $S_p$ central and $G/S_p$ nilpotent (order $q^2$ is abelian). It follows that $G$ is nilpotent, and hence is the product of its Sylow subgroups $G = S_p \times S_q$ and $S_q$ has order $q^2$ and is hence abelian.
A: Let suppose $|Z(G)|=p$ (else $G/Z(G)$ is cyclic).
Let $S$ be the subgroup generated by an element $s$ of order $q$ and consider $C(S)$, the centralizer of $S$ (the biggest subgroup of $G$ such that every element of $C(S)$ commutes with every element of $S$).
What about the cardinality of this subgroup?


*

*On the one hand, by Sylow theorems, $s$ is contained in a $q$-Sylow $Q$, that have to be abelian, so $Q < C(S)$.

*On the other hand, the (unique) $p$-Sylow $P$ is contained in the center of $G$ and then $P < C(S)$.


Hence $C(S)=G$ (looking at their the cadinality) and then we have an absurd because this means that $|Z(G)| > p$.
A: Clearly $|Z(G)|=p$ and index$[G:Z(G)]=q^2$, so $Z(G)$ is normal Hall-subgroup. By the theorem of Schur-Zassenhaus it has a complement $H$, so $G=HZ(G)$, $H \cap Z(G) =1$. Hence $|H|=q^2$ and $H$ is abelian. But then $G=HZ(G)$ must be abelian.
Note without Schur-Zassenhaus: in general if $G/Z(G)$ is abelian, then $G$ is nilpotent. And hence $G$ is the direct product of its Sylow subgroups. In this case it follows that $G$ is abelian. By the way note that you must assume that $p \neq q$, otherwise the statement of the OP is not true.
