TITLE: Let G be a group with exactly two nontrivial proper subgroups. Show that G is cyclic. What are the possible orders of G?
QUESTION [6 upvotes]: Let G be a group with exactly two nontrivial proper subgroups. Show that G is cyclic.  What are the possible orders of G?
Proof:
Assume G has no nontrivial subgroups.
Because G is trivial by the assumption above, then G is cyclic.
If G has exactly one nontrivial subgroups H, consider the subgroup generated by a nonidentity element g in G/H
Now suppose that H and K are the only nontrivial subgroups of G.
Recall that a group is never the union of two proper subgroups....
(Above is the start I have to my proof. I haven;t finished proving it is a cyclic group and can't figure out how to find what the possible orders may be.)

REPLY [2 votes]: This is exercise 35 in the additional exercises to chapter 1-4 in Gallian's Contemporary Abstract Algebra. 
The possibilities for $|G|$ are $pq$ and $p^3$ for some primes $p,q$. 
To see this consider a group $G$ with exactly two non trivial proper subgroups and let $g\in G \setminus \{e\}$. Then $\langle g \rangle$ is a subgroup. If $\langle g \rangle = G$ then $G$ is cyclic. 
If $\langle g \rangle \subsetneq G$ let $h \in G\setminus \langle g \rangle$. Then again $\langle h \rangle $ is a subgroup and if $\langle h \rangle = G$ then $G$ is cyclic. If $\langle h \rangle \subsetneq  G$ note that since $\langle g \rangle \cup \langle h \rangle \subsetneq G$ there is $x \in G \setminus \langle g \rangle \cup \langle h \rangle$. Since $\langle x \rangle$ is a subgroup that is neither equal to $\langle g \rangle$ nor to $\langle h \rangle $ it must be true that $\langle x \rangle = G$ hence $G$ is cyclic.
Now we have shown that $G$ is cyclic. The claim about the order of $G$ follows directly from the fact that in a cyclic group there is a subgroup for each divisor of the order of the group.