TITLE: Can we conclude that this group is cyclic?
QUESTION [10 upvotes]: Let $G$ be a finite group. If, for each positive integer $m$, the number of solutions of the equation $x^m = e$ in $G$, where $e$ is the identity element, is at most $m$, then can we conclude that $G$ is cyclic?

REPLY [11 votes]: Let $|G| = n$ and $m \mid n$. Define $G_m = \{g \in G : |g| = m\}$.
Suppose $G_m$ is not empty and let $g \in G_m$. By assumption, $x^m = e$ has at most $m$ solutions in $G$. Since each element of $\langle g \rangle$ is a solution, there cannot be more. From those, there are $\varphi(m)$ elements with order exactly $m$. This is a basic result on cyclic groups, where $\varphi$ is Euler's totient function.
It follows that $|G_m| = \varphi(m)$ if $G_m$ is not empty. If $G_m$ is empty, then $|G_m| = 0$. In general, $|G_m| \le \varphi(m)$.
Now we have:
$$
n = |G| = \sum_{m \mid n} |G_m| \le \sum_{m \mid n}\varphi(m) = n
$$
Therefore, the inequality is in fact an equality. This shows that $|G_n| = \varphi(n) > 0$. Hence $G$ is cyclic since it contains an element of order $n$.