For subgroups $H,K$ of $G$ if $HK$ is always a subgroup, is $G$ abelian

abelian-groupsgroup-theory

This is a well known theorem from elementary group theory.

Let $G$ be a group and $H,K\leq G$, Then $HK$ is a subgroup of $G$ if and only if $HK=KH$.

As a consequence of this, if $G$ is abelian, then $HK$ is always a subgroup.

I am curious, if we can say the other way around. If $HK$ is always a subgroup for subgroups $H,K\leq G$, is $G$ necessarily abelian?

This is my progress so far. If $G$ has no nontrivial subgroups, that is $G\{e\}=G$ surely is a subgroup, but then $G$ is necessarily abelian. Because if it wasn't, then it is also not cyclic thus has a nontrivial subgroup.

We wish to show that $gh=hg$ for all $h,g\in G$. So maybe we can consider $\langle g\rangle, \langle h \rangle$. But what next?

Best Answer

It is also well known that $HK$ is a subgroup if at least one of them is normal. And so a counterexample will be any non-abelian group having all subgroups normal, a.k.a. a hamiltonian group. For example the quaternion group $Q_8$.

EDIT: I was too hasty to claim that $pq$ groups satisfy your condition. Removed from the answer.