I have a partial proof of the following problem but I am struggling with a final case. Hints would be appreciated to solve this final case I am left with and please don't post a full solution. Thanks in advance!
Problem:
Show that if |G| = pq for some primes p and q (not necessarily distinct) then either G is abelian or Z(G) = 1.
notes:
Z(G) is the center of a group G.
Proof
Let G be a group with |G| = pq, where p and q are prime.
Let Z(G) $\ne$ {1}.
Then let z $\in$ Z(G) such that z $\ne$ 1.
Then if we can find an element of order pq, we are done since its cyclic group would have order pq and hence G is cyclic and hence abelian.
So assume |z| = p (it can be either q, p or pq by Lagrange's theorem, but pq would yield us our desired result that G is abelian).
case 1:
Let |x| = q where p $\ne$ q.
Then we have that (zx)$^p$ = z$^p$x$^p$ = x$^p$ $\ne$ 1 since p cannot divide q since q is prime.
Then (zx)$^j$ = 1 for some j where j must divide pq. j cannot be p as shown above and similarly cannot be q. Then j can only be 1 or pq.
If j = 1 then we have that zx = 1 and that z = x$^{-1}$. But then we have that z$^p$ = 1 which implies x$^{-p}$ = 1. But this cannot be the case since q = |x| = |x$^{-1}$| = p. Hence j must equal pq and so zx generates all of G and G is thus abelian.
case 2:
Let p = q.
Then |G| = p$^2$. Also we know that every element of G must be of order 1 or order p by Lagrange's theorem. If there is an element of order p$^2$ then we are done in showing G is abelian.
I'm not sure how to proceed though, I noted that the normalizer of Z(G) = G and tried to construct the product of the two subgroups Z(G) and a cyclic subgroup but that didn't get me very far.
Hints would be appreciated on how to proceed! Thanks.