Question : If $|G|=pq$ where $p$ and $q$ are primes that are not necessarily distinct. Prove that the order of $Z (G) =1$ or $pq$.
Showing the order is $pq$ is trivial.
I unsure how to start with showing the order is $1$. Hints are appreciated.
Thanks in advance.
By Lagrange theorem, $|Z(G)|=1,p,q$ or $pq$.
If $|Z(G)|=p$ or $|Z(G)|=q$ the quotient group $G/Z(G)$ has prime order (respectively $q$ or $p$). So $G/Z(G)$ is cyclic, and so $G$ is abelian (proof here). But if $G$ is abelian, then $Z(G)=G$, so $|Z(G)|=pq$. So there is a contradiction.
Finally : $|Z(G)| = pq$ or $1$.