Let $(G,\cdot)$ be a finite abelian group and $m\in\Bbb{N}$. Prove that $S=\{g\in G\mid(o(g),m)=1\}\le G$. I am aware that I need to show that given any $g_1,g_2$ in $S$ if $(o(g_1g_2^{-1}),m)=1$ then $S$ will be a subgroup of $G$.

Now let $o(g_1)=r,o(g_2)=s,o(g_1g_2^{-1})=t$. Since $G$ is abelian we have 

$$\begin{align}
(g_1g_2^{-1})^{rs}&amp;=g_1^{rs}(g_2^{-1})^{rs}\\
&amp;=(g_1^r)^s((g_2^s)^{-1})^r\\
&amp;=e^s(e^{-1})^r\\
&amp;=e^se^r.
\end{align}$$ 

This implies that $t\mid rs$. Now we must show that $(t,m)=1$. I could not find a way to show this.

Any help here will be appreciated. Thanks in advance.
If $g,h\in S$, if $a=o(g)$ and $b=o(h)$, then $o(h^{-1})=b$ and (since $G$ is abelian)$$o(gh^{-1})\mid o(g)o(h^{-1})=ab.$$Since both $a$ and $b$ are coprime with $m$, then so is $ab$ and therefore then so is $o(gh^{-1})$. In fact, if $o(gh^{-1})$ and $m$ are not coprime, then there is a prime number $p$ such that $p\mid o(gh^{-1})$ and $p\mid m$. But$$p\mid o(gh^{-1})\implies p\mid ab\implies p\mid a\text{ or }p\mid b.$$But this is impossible, since $(a,m)=(b,m)=1$.
If $t|rs$, and $(r,m)=(s,m)=1$, then $(t,m)=1$.  For suppose $p|t$, where $p$ is prime.  Then  $p|r\lor p|s$.  This is Euclid's lemma.

If you're having trouble seeing it, perhaps think of the unique prime factorizations guaranteed by the fundamental theorem of arithmetic.