In a finite group $G$ if every element is of some prime power order (prime may vary with element) and if $G$ has non trivial center then prove that $G$ is actually of prime power order. Deduce that any group G of order pq (where p and q are distinct primes) with non trivial center is cyclic.
Let $g\neq 1$ be in the center, and have prime order divisible by $p$.
Suppose there is another element $h$ with prime power divisible by $q\neq p$. Since $h$ and $g$ commute, the order of $hg$ has to be the least common multiple of the orders of $h$ and $g$, but that is clearly not prime power. Hence no such $h$ exists in $G$, and $G$ is a $p$ group. As such it has order a power of $p$.
If $G$ had order $pq$ but was not cyclic, then the only possible orders of elements are $p$ and $q$ and 1 (but of course, the identity is the only thing with order 1): these are all prime powers (with $1=p^0$, I suppose). If the center were nontrivial, then by the first part $pq$ is a power of a prime: this is a contradiction. Hence $G$ must be cyclic.