Let $D$ be an integral domain $a,b \in D$. $m,n$ are relatively prime and $a^n=b^n$ and $a^m=b^m \implies a=b$.
I quickly realized that since $m,n$ are relatively prime then $\exists p,q \in \mathbb{Z}$ s.t. $pm+qn=1$.
So we have $a^m=b^m \implies a^{pm}=b^{pm}$ and similarly $a^{qn}=b^{qn}$.
Then $a^{pm} a^{qn}=b^{pm} a^{qn} = b^{pm}b^{qn} \implies$ $a^{pm+qn}=b^{pm+qn} \implies a=b$.
Now my concern is I didn’t use any properties of integral domain. Am I jumping the gun here? What mistake did I make?