My reference for learning abstract algebra says that in an abelian group $G$ the product of two elements (say $a$ with order $n$ and $b$ with order $m$) has order $mn$ if $gcd(n,m) = 1$.
What I don't understand is where the $gcd(m,n)=1$ comes into use in proving this fact? For example, $ a^{mn} = (a^n)^m = (e)^m = e$ (identity element). A similar argument for $b^{mn}$ together with the fact that $G$ is abelian is enough to show that $(ab)^{mn} = e$. From here, how do I conclude for an integer $r < mn$ that $(ab)^r \neq e$
Also, are there any other conclusion that can be drawn if $gcd(n,m) \neq 1$ ?
Thanks for any feedback in advance !