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?