Cosets and Lagrange's theorom

Solution 1:

Suppose towards contradiction, assume that g isn't equal to e. This means g^m=e which implies |(g)|=k for some k > 1 that divides m. By La grange's theorem, we know that k divides n, so gcd(m,n)=k. This contradicts the statement of our question that n,m are relatively prime, so our assumption is false and g=e.

Solution 2:

You know that if $g^m =e$, then the order of $g$ divides $m$. But from Lagrange, the order of $g$ divides $n$ as well. What integer divides $m$ and $n$, if they are relatively prime?

Solution 3:

$$(n,m)=1\iff \exists\,x,y\in\Bbb Z\;\;s.t.\;\;nx+my=1\implies$$

$$g=g^1=g^{nx+my}=\left(g^x\right)^n\cdot\left(g^m\right)^y=1\cdot1=1$$