Let $\displaystyle G$ be a group with a prime number $\displaystyle p$ of elements. If $\displaystyle a \in G$ where $\displaystyle a \neq e$,

then the order of $\displaystyle a$ is some integer $\displaystyle m \neq 1$.

But then the cyclic group $\displaystyle \langle a \rangle$ has $\displaystyle m$ elements.

By Lagrange's theorem, $\displaystyle m$ must be a factor of $\displaystyle p$.

But $\displaystyle p$ is a prime number, and therefore $\displaystyle m = p$.

It follows that $\displaystyle \langle a \rangle$ has $\displaystyle p$ elements, and is therefore all of $\displaystyle G$!

Conclusion:

If $\displaystyle G$ is a group with a prime number $\displaystyle p$ of elements, then $\displaystyle G$ is a cyclic group. Furthermore,

any element $\displaystyle a \neq e$ in $\displaystyle G$ is a generator of $\displaystyle G$.

The author said that:

"But then the cyclic group $\displaystyle \langle a \rangle$ has $\displaystyle m$ elements."

I understand that the cyclic group has $\displaystyle m$ elements. No problem there. I understand this statement is true for the generator $\displaystyle a$.

But why the group $\displaystyle G$ has to be definitely cyclic at the end?

Why the cyclic group $\displaystyle \langle a \rangle = G$?

Can't there be situations where $\displaystyle aaaa....a \notin G$ because we didn't say that $\displaystyle \langle a \rangle$ is a subgroup of $\displaystyle G$?

So how did he come to the conclusion that $\displaystyle G$ is cyclic?