I hope this is not a duplicate. First of all, in what follows I'm not allowed (unfortunately) to use the structure theorem for abelian groups. I'm asked to prove the following:
Let $G$ be an abelian group with $\vert G\vert =mn$ and $\gcd(m,n)=1$. Prove that $G$ is $H\times K$ with $H,K\leq G$, $\vert H\vert =m$ and $\vert K\vert =n$.
There's a hint: consider $G^{m}:=\{g^{m}\in G:\ g\in G\}$ and $G^n$ analogously defined.
Well, $G^m$ and $G^n$ are subgroups of $G$ because they are the images under the maps $g\mapsto g^m$ and $g\mapsto g^n$ from $G$ to $G$ and such functions are homomorphisms because $G$ is abelian. By the fact that $$o(g^m)=\dfrac{o(g)}{\gcd (o(g),m)}$$ (where $o(g)$ denotes the order of $g$) and using $\gcd(m,n)=1$, I easily get that $G^m\cap G^n$ is trivial. It is also easy to show that $G^m G^n=G$, writing $1=um+vn$ for some $u,v\in\mathbb{Z}$. Since $G$ is abelian, both subgroups are normal and I get $G^m \times G^n\cong G$. The question is: "How do I show that $\{\vert G^m\vert,\ \vert G^n\vert\}=\{m,n\}$?" I tried to look at the kernel of, say, $g\mapsto g^m$ which is the set of all elements of $G$ whose order divides $m$ and noticed that $G^{n}\subseteq \ker (g\mapsto g^m)$ but I can't go any further.
Any help would be appreciated. Thanks.