Assume that $a$ is left cancelable monoid. That is $ab=ac$ implies $b=c$
Prove that if $a^m=b^m$ and $a^n=b^n$ such that $m$ and $n$ are relatively prime, then $a=b$.
Here is what I've done so far $a^m=b^m\implies a^na^m=a^nb^m \implies a^na^m=b^nb^m\implies a^{n+m}=b^{n+m}$.
I figure that this is where the fact that $\gcd(m,n)=1$ comes into play and shows that $a=b$, but I am not sure why. Have I gone in the wrong direction?
Hint: Bezout's identity ensures that $1=xm+yn$ for some integers $x,y$ if $\gcd(m,n)=1$.