How do I show that a finite group $G$ of order $n$ is cyclic if there is at most one subgroup of order $d$ for each $d\mid n$? This particular question was asked in masters exam for which I am preparing and I could not solve it.

Question:
(a) Prove that if $G$ is a finite group of order $n$ such that for integer $d>0$, $d\mid n$, there is no more than one subgroup of $G$ of order $d$, then $G$ must be cyclic .
(b) Using (a) prove that multiplicative group of units in any finite field is cyclic.

For (a), I thought that as $n\mid n$ and there is only one subgroup of $G$ of order $n$ and order of a subgroup is order of element so, there exists an element $a$ such that $|a|=n$. But same argument can be used if statement says that there are more than one subgroup of order $d$ for each $d \mid n$. So, what mistake I am making? and kindly tell right approach.
For (b), the number of elements of in group is $p^{n} -p^{n-1}$. I don't know how can I show that there exists an element equal to order of the group.
 A: The usual way to go about this classic problem is the following.
Let $G=\cup G_d$ where $G_d$ is the set of elements of $G$ of order $d$ for each $d|n$.
Since there's at most one subgroup of order $d$, $|G_d|\leq\varphi(d)$
However, $\sum_{d|n}\varphi(d)=n$ and $|G|=\sum_{d|n}|G_d|$, therefore it must be that $|G_d|=\varphi(d)$ for all $d|n$, and in particular, there is an element of order $n$, so $G$ is cyclic.
Now let $G$ be the multiplicative group of units of a finite field. Assume $d|n$ and $G_d \neq \emptyset$. Since any element of $G_d$ generates a cyclic group of order $d$, there must be at least $\varphi(d)$ such elements. However, the elements of the cyclic group are roots of $X^d-1=0$ which has at most $d$ roots in a field, so the cyclic group is the set of its roots. So $G_d$ is entirely contained in the cyclic group and $|G_d|=\varphi(d)$. Once again, since $\sum_{d|n}\varphi(d)=n$, it must be that $G_d \neq \emptyset$, so in particular there is an element of order $n$ and $G$ is cyclic.
