Verification of Proof that a nonabelian group $G$ of order $pq$ where $p$ and $q$ are primes has a trivial center 
A nonabelian group $G$ of order $pq$ where $p$ and $q$ are primes has a trivial center

My Proof is as follows: 
Assume we have nonabelian group $G$ of order $pq$ where both $p$ and $q$ are primes.  When $G$ has a trivial center it means subgroup $Z(G)=\{e\}$.  If a group is of order $pq$ then the order of its subgroup must divide pq meaning $Z(G)$ has to be of order $1$, $p$ or $pq$.  It cannot be $pq$ otherwise $Z(G)$ would be a group equivalent to $G$ and not a subgroup.  It cannot be $p$ or $q$ because otherwise $Z(G)$ would be cyclic and therefore abelian.  So $Z(G)$ must be or order $1$.  
Is this correct?  A hint I was given was to use the fact that if $G/Z(G)$  is abelian then it is cyclic.  How would that be incorporated?
 A: I think the correct hint is:

If  $G/Z(G)$ is cyclic then $G$ is abelian.

$Z(G) \subseteq G$ and so we can have $$|Z(G)| = 1, \ p , \ q , \ pq $$ $G$ is nonabelian and so $|Z(G)| \neq pq $.
If $|Z(G)| = p $ or $|Z(G)| = q $ the quotient group $G/Z(G)$ has prime order, whence is cyclic and by the hint $G$ is abelian.
Thus $|Z(G)| = 1$
A: Your result can be proved directly:
Suppose $Z(G) \neq \{1 \}$. Because $G$ is not abelian, $Z(G)$ has order $p$ or $q$; say $|Z(G)|=p$. In particular, there exists $x \in Z(G)$ of order $p$. Let also $y \in G$ of order $q$. Now, it is easy to notice that the set $$X= \{ x^m y^n \mid 1 \leq m \leq p, \ 1 \leq n \leq q \}$$ has cardinality $pq$, hence $G=X$. Now, because $x \in Z(G)$, we clearly deduce that $G$ is abelian: a contradiction.
A: Let's assume $|Z(G)|=q$; then $|C_G(g)|=q$ for every noncentral $g\in G$, whence $\frac{|G|}{|C_G(g)|}=\frac{pq}{q}=p$ for every noncentral $g\in G$. From the Class Equation ($pq=q+q(p-1)$), follows: $q(p-1)=kp$, where $k$ is the number of noncentral conjugacy classes of $G$: contradiction, because $p\nmid q(p-1)$. The same argument holds by swapping $p$ and $q$, and hence $|Z(G)|\ne p$ as well. As $G$ is nonabelian, we are left with $Z(G)=1$.
A: More generally, let $G$ be of order $pq$. If it has center of order $p$, then every noncentral element $g$ has centralizer of order $kp$ for some integer $k>1$, because $Z(G)<C_G(g)$, and then necessarily $k=q$, because $C_G(g)\le G$ and for the primality of $q$. But then $C_G(g)=G$, and hence $g\in Z(G)$: contradiction. Same argument and conclusion if the center has order $q$. Therefore, the center has order $1$ or $pq$. So, if $G$ is assumed nonabelian, it must be centerless.
