In a P.I.D., if $a^m = b^m$ and $a^n = b^n$ for $m, n \in \mathbb{N}$ with $\gcd(m,n) = 1$, then $a=b$ 
Let $R$ be a principal ideal domain, and $a, b \in R$ with $a^m = b^m$ and $a^n = b^n$ for $m, n \in \mathbb{N}$, and $\gcd(m, n) = 1$. I now want to show that we then already have $a = b$.

I think the statement is easily seen to be true if $a = 0$ (or $b = 0$), since if $a = 0$ and $a^m = b^m$, then $a = b$ since $R$ doesn't contain any nontrivial zero divisors, so $b ≠ 0$ already implicates $b^m = b \cdot b^{m-1} ≠ 0$.
I don't really know how to prove the statement for the general case, where I can't directly apply the fact that $R$ doesn't have any zero divisors except $0$. I most likely have to use the fact at some point that $gcd(a, b) = 1$, but I'm not sure how.
 A: If $b\ne 0$, it means that, in the quotient field $Q$ of $A$, we have $\Bigr(\dfrac ab\Bigl)^m=1$ and $\Bigr(\dfrac ab\Bigl)^n=1$ .
Now consider a Bézout's relation $um+vn=1,\enspace m,n\in\mathbf Z$. From the above, we deduce
$$\frac ab=\Bigr(\dfrac ab\Bigl)^{um+vn}=\Bigr(\dfrac ab\Bigl)^{um}\Bigr(\dfrac ab\Bigl)^{vn}=\biggl(\Bigr(\dfrac ab\Bigl)^m\biggr)^u\biggl(\Bigr(\dfrac ab\Bigl)^n\biggr)^v=1^u\cdot 1^v=1,$$
which means $a=b$.
Added:
B.t.w., it has nothing to see with $A$ being a P.I.D and is valid for any integral domain. The only PIDness in use here is that of $\mathbf Z$.
A: Use the $\gcd$ algorithm: there exist $x,y\in\mathbb Z$ such that $mx + ny = 1$. 
$$a = a^{mx + ny} = (a^m)^x(a^n)^y= (b^m)^x(b^n)^y = b^{mx + ny} = b$$
The only subtlety: one of $mx$ or $ny$ could be negative, but we can argue that one of $mx > |ny|$ or $ny > |mx|$ holds because the sum is strictly positive, and apply cancellation (PID $\Rightarrow$ integral domain) carefully to obtain the result.
A: Hint $\ $ The set $\,S\,$ of $\,k\in \Bbb N\,$ such that $\,a^k = b^k\,$ is closed under subtraction $> 0\,$ so, by  a 1-line proof, its least element $\,d\,$ divides every element, so $\,d\mid m,n\,$ coprime, thus $\,d =1.\ \ $ QED
Remark $\ $ More conceptually, in the quotient field the order $\,d\,$ of $\, a/b\,$ divides the coprimes $\,m,n\,$ thus $\,d=1,\,$ so $\,a/b = 1,\,$ so $\,a=b.$ 
Note the proof that $\,S\,$ is closed under subtraction depends on $\,a,b\,$ being cancellable, e.g. cancelling $\,a^3\! = b^3\,$ from  $\,a^5\!= b^5\,$ yields $\,a^2\! = b^2,\ $ i.e. $\ 5,3\in S\,\Rightarrow\, 5-3 = 2\in S$.
A: If $m, n \in \mathbb{N}$ and $\gcd(m, n) = 1$, then there are $u,v \in \mathbb{N}$ such that $mu=1+nv$ or $1+mu=nv$ because the Euclidean algorithm gives $u',v' \in \mathbb{Z}$ such that $mu'+nv'=1$ and exactly one of $u'$ or $v'$ is negative. Assume wlog that $mu=1+nv$. Then
$$
a \cdot a^{nv} = a^{mu} = b^{mu} = b \cdot b^{nv} = b \cdot a^{nv}
$$
Since $R$ is domain, we can cancel $a^{nv}$ and get $a=b$.
