Can a group with exactly five subgroups be nonabelian? I was wondering if there is an example of a nonabelian group $G$ with exactly five subgroups. Let $G$ be a such group, and let $a,b\in G$ be such that $ab\ne ba$. Let us concentrate on the subgroups $\langle a\rangle, \langle b\rangle, \langle ab\rangle$ and $\langle ba\rangle$. 
If $a$ commute with $ab$ or $ba$, then $a$ would commute with $b$, and similarly for $b$ instead of $a$. Therefore the only possible inclusion between our cyclic subgroups is between $\langle ab\rangle$ and $\langle ba\rangle$; in particular none of the considered cyclic subgroups can be equal to $\{e\}$ or $G$.
Thus, the three nontrivial proper subgroups of $G$ are $\langle a\rangle, \langle b\rangle$ and $\langle ab\rangle=\langle ba\rangle$, and $G=\langle a,b\rangle$. Each one of these three subgroups must have prime order and they intersect trivially. Finally, $G$ must be finite (every group with finitely many cyclic subgroups is finite; prove it!) and $|G|$ is multiple of at most three primes.
Any ideas to "concretize" this hypothetical group?
 A: If exactly $3$ primes divide the order of the group, then the order must be $pqr$, since if the square of any of the primes, say $p$, divided the order, the Sylow-$p$ would have at least $2$ nontrivial subgroups, which would give at least $6$ total subgroups.
Now, there is exactly $1$ Sylow-$p$, Sylow-$q$, and Sylow-$r$, so they must all be normal, which means that this group is $C_{pqr}$, a cyclic and abelian group. But note that this has $8$ subgroups.
Now, assume only $2$ primes divide the order. Either the order is $pq$ or $p^2 q$. In the former case, there must be exactly $2$ subgroups of order $p$ and $1$ of order $q$, WLOG. But then we'd have that $2\equiv 1 \ \text{mod} \ q$, which is impossible. Thus, the order must be $p^2q$. This means the Sylow-$p$ can only have $2$ nontrivial subgroups, so it must be $C_{p^2}$. Since both Sylow's are, again, unique and thus normal, this group is $C_{p^2 q}$. But note that this doesn't even work, despite being abelian, since this group has $6$ subgroups.
The final case is where we have a $p$ group. Since a group of order $p^n$ has subgroups of all possible $n+1$ orders, the order is at most $p^4$. If the order is $p^4$, then since the group has a unique subgroup of every divisor of the order, it's cyclic. If the order is $p^3$, and the group is nonabelian, then the center must have order exactly $p$, and quotienting out by it must give $C_p\times C_p$, since if the quotient by the center were cyclic, the group would be abelian. 
But $C_p\times C_p$ itself has $p+1$ subgroups of order $p$, which gives $p+1$ subgroups of order $p^2$ in the original group. This is too many, since we only have room for one extra subgroup.
Finally, every group of order $p$ or $p^2$ is abelian.
Thus, there is no nonablian group with exactly $5$ subgroups. In fact, it seems that the only abelian groups with $5$ subgroups are the cyclic groups of order $p^4$, and the Klein-Four group.
A: Such a group cannot exist.
Let $p,q,r$ be the three primes, not necessarily distinct.
If $x \in G \backslash \{ e\}$ then, as $G$ is not cyclic, $<x>$ can only be $<a>, <b>$ or $<ab>$.
It follows that $<a>  \backslash \{ e\}, <b>  \backslash \{ e\}, <ab>  \backslash \{ e\}$ is a partition of $G \backslash \{ e\}$.
This shows that 
$$|G|-1=p+q+r-3$$
or 
$$|G|=p+q+r-2$$
In particular $G$ is finite and $p,q,r, | |G|$.
Now, without loss of generality, assume $ p \leq q \leq r$.
Then $r ||G|=p+q+r-2$, therefore $r|p+q-2$. As $1< p+q-2 < 2r$, and $r$ is prime, we get
$$r= p+q-2 \,.$$
Now, since $p,q,r$ are prime with $p \leq q \leq r$, a simple parity argument shows that they cannot all three be even. Therefore $p=2$ and $q=r$.
This shows that
$$ord(a)=2, ord(b)=ord(ab)=ord(ba)=r$$ 
If $r \neq 2$ then $bab^{-1}$ is also an element of order $2$ which cannot be $a$, and hence generates a new subgroup of order $2$.
If $r=2$, as every element must belong to a non-trivial subgroup, every element has order at most two, thus $G$ must be Abelian.
A: I worry that you claim $G$ has at most three prime divisors. I assume this is because each of $\langle a \rangle$, $\langle b\rangle$, and $\langle ab \rangle$ have prime order. However, subgroups cannot choose one prime each and this is a very important part of the structure of finite groups.
Here is something to get you thinking: Let $g,h,k$ be elements of a group. Then $k^{-1} (gh) k = k^{-1} g k \cdot k^{-1} h k$ so subsets of the form $\{ k^{-1} x k : x \in H \}$ are subgroups if and only if $H$ is a subgroup. These are called conjugate subgroups, and that set is usually called $k^{-1} H k$ or just $H^k$ for short. Notice that $k^{-1} g k = k^{-1} h k$ if and only if $g = h$, so conjugate subgroups have the same order.
This means that when $\langle a \rangle$ claims the prime $p$, we gets lots of subgroups of order $p$: $H=\langle a \rangle$ and all of its conjugates. If $\langle b \rangle$ claims the prime $q$, then we get $H$, $H^b$, $H^{b^2}$, $H^{b^3}$, all the way to $H^{b^{q-1}}$. Since $q$ is prime, Lagrange's theorem shows that either we just got $q$ different subgroups with order $p$, or every single one of them is the same.
One of Galois's insights is that in this case (all the conjugates of $H$ are equal) we can form a smaller group $G/H$, where the elements are subsets of the form $Hb^i$ for $i=0,1,\ldots,q-1$. Each of those subsets are disjoint, so we get a total of $pq$ elements.
In other words, the idea of conjugate subgroups should have immediately led you to conclude $G$ is divisible by at most 2 primes, and pretty soon that those primes had to both be at most 2, but that they needed to be different primes. (So, no, sorry there is no such group.)
At any rate, each prime $p$ dividing the order of a group brings with it an entire space of $p$-subgroups, and it is very difficult for that space to be small. The only way it can be small is when nothing commutes (you have gotten that idea already, so that's very good). The way things commute is described by a graph whose vertices are the primes dividing the group order and edges exist between $p$ and $q$ if there is an element of order $p,q$. In order for both the $p$-space and the $q$-space to be "skinny", it is necessary that $p$ and $q$ be connected in the graph, but then you get a whole new space of $pq$-groups.
