By hypothesis G is not trivial. Let x ∈ G with x not equal to e. Then <x> is a nontrivial subgroup, which
must then equal G by hypothesis. Thus G is cyclic. Then G has a subgroups of every order
dividing |G|. Since none of these subgroups is proper, |G| must be prime.