First attempt and proof
Let be a UFD and write for its fraction field; write for the canonical inclusion of rings. My goal is to show that any polynomials that are relatively prime in continue to be relatively prime polynomials as elements of .
Take two non-zero, non-unit polynomials and in . Because we are working in a UFD, they both admit a unique prime factorization: where each and are irreducible polynomials. Suppose that and are not relatively prime in ; we will show that in this case and are also not relatively prime in .
Notice that if all ’s were constants, then would be invertible, contrary to our hypothesis that and are not relatively prime; the same argument shows that at least one of the ’s is not a constant. Since for our purposes it suffices to exhibit a common irreducible factor, we can, without loss of generality, suppose that none of the ’s and ’s are constant polynomials.
By Gauss’ Lemma on polynomials, all of the ’s and ’s are irreducible polynomials in . Let be an irreducible factor of and . We must have and for some indices and . Because is an injective function, this yields . Hence and share an irreducible factor, so they are not relatively prime.
EDIT In fact, this does not yield , but only that divides . This is still sufficient for the proof to conclude.
Second attempt and proof
The resultant gives a better result and proof, in my opinion. As before, let be a UFD and write for its fraction field. Let and be two polynomials in , with respective degrees and , both degrees . Recall that their resultant is where each -line is repeated times and each -line repeated times in order to get a square matrix. Now it is a nice and simple fact (see for instance Algebraic Curves, Walker 1991, p.24) that is zero if and only if and have a common non-constant factor, i.e. if and only if and are not relatively prime in . But the vanishing of is independant of wether we consider its matrix as a matrix with coefficients in , or with coefficients in . In other words, the resultant of and seen as polynomials in vanishes if and only if the resultant of and seen as polynomials in vanishes.
Let me be a bit more precise. Let and be two generic polynomials of positive degrees and , respectively. Write and . Now their resultant is a polynomial in the variables , , , , etc. Let be the injective canonical map of rings. Because is injective, we must have that vanishes at some point if and only if the image of the polynomial in vanishes at .
To conclude: two non-constant polynomials in are relatively prime in if and only if their images are relatively prime in ; and if two arbitrary polynomials in are relatively prime in , then their images are also relatively prime in (for instance, and are relatively prime in but not in , so for the converse implication to work we really need both polynomials to be non-constant).
EDIT This is Theorem 9.5, p.25 in Walker’s Algebraic Curves (1991).