I'd like to review the reasoning of this question for the case $p=q$. It says
If $|G|=pq$ where $p$ and $q$ are primes that are not necessarily distinct. Prove that $G$ is abelian or $Z(G)=1$.
This question is already answered here for the case $p \ne q$.
The reasoning is:
$Z(G)$ is a subgroup of $G$ and then $|Z(G)|$ is $1,p,q$ or $pq$. If $|Z(G)| = p$ then $G/Z(G)$ has order $q$ and therefore is cyclic, which means $G$ is abelian and that is a contradiction because in that case we would have $Z(G)=G$.
We conclude $G$ is abelian or $Z(G)=1$.
Now, if $p=q$ what part of the previous reasoning fails? I mean, we still could say "since $|G| = pp$ then $|Z(G)|$ is $1,p$ or $pp$. If $|Z(G)|=p$ then $G/Z(G)$ has prime order and hence is cyclic" and conclude again $G$ is abelian or $Z(G)=1$. However if $G$ has order $p^2$ ($p$ prime) then $Z(G) \ne 1$, according to a further result.
So as much as possible, without involving the class equation I'd like to know what is wrong with that proof for the case $p=q$ (actually this problem is in Dummit&Foote and it is supposed to be solved without class equation).