Finite group of order $mn$ with $m,n$ coprime I have a problem. It states that: 

Let $G$ is a group and $|G|=mn$, $(m,n)=1$. Assume that $G$ has exactly one subgroup $M$ with order $m$ and one subgroup $N$ with order $n$. Prove: $G$ is a direct product of $M$ and $N$.

Here is my approach: 
Obviously, we have $M\cap N = 1$. By Product Formula we have: $|MN|=|M|\cdot|N|=mn$.
Let $m_1$, $m_2$ be in $M$ and $n_1$, $n_2$ in $N$. If  $m_1n_1=m_2n_2$ then $m_2^{-1}m_1=n_2n_1^{-1}$. By $M\cap N = 1$ we must have $m_1=m_2$, $n_1=n_2$. So those elements in the form $m_in_j$ with $m_i\in M$, $n_j\in N$ are distinct. Because $|G|=mn$ we must have $G=MN$. 
I'm kind of confused because it seems the uniqueness of subgroups $M$ and $N$ is useless. Is my proof still correct without this hypothesis or I mislead at certain point? Please explain to me. 
 A: In general, $MN=\{mn\mid m\in M, n\in N\}$ is not a group, but in this case $MN$ is a group by considering its cardinality as comment said. But $G=MN$ does not implies $G\simeq M\times N$. To show that $G$ is isomorphic to $M\times N$, we have to show that elements of $M$ and $N$ commute, i.e. $mn=nm$ for all $m\in M, n\in N$. By the uniqueness condition we can show that $M, N$ are normal subgroups of $G$. Then $mnm^{-1}n^{-1}\in M\cap N$ (why?), so $mnm^{-1}n^{-1}=e$ and they commute. Then $(m,n)\to mn$ became an isomorphism between $M\times N$ and $MN=G$. 
A: Just because every element in $G$ can be written uniquely as $nm$ that does not mean $G = M\times N$. For example, $G$ could be a semidirect product, like a dihedral group.
By the way, the notation $G=M.N$ usually means an "extension of $N$ by $M$" which means $M$ is (isomorphic to) a normal subgroup of of $G$ and $G/M \cong N$. This is much weaker than you are trying to show.
This is from the Atlas of Finite Groups:

A: You say "obviously , we have $M\cap N=1$". This "obvious" is not obvious at all. At this point you dont use the hypothesis. 
This is generaly how one detect mistakes in proofs : when the author write "obviously", or "it is easy to see that", there is a serious doubt.
To prove the "obvious", just says that $M\cap N$ hase order dividing the order of $M$ and $N$ (Lagrange), so  the order of this group is 1.
By the way, if $p$ is a prime number, let $G=S_p$ the symmetric group on $\{1,...p\}$ letters, $M=S_{p-1}$ the symmetric group on $\{1,...p-1\}$ letters and $H$ the subgroup of $G$ generated by a cyclic permutation $(1,2,...p)$. Then $G=MN$ but this is not a product group.
