GCD in a subring is GCD in a bigger ring? Let $R$ be a UFD which is a subring of an integral domain $S$. If $r_1$ and $r_2$ are two nonzero elements of $R$ with GCD $d$, is it true that $d$ is also a GCD of $r_1$ and $r_2$ in $S$?
I know this is true if $R$ is a PID.
 A: No, e.g. $\rm\:\gcd(2,x) = 1\:$ in $\rm\:\mathbb Z[x]\:$ but the gcd is the nonunit  $\:2\:$ in $\rm\:\mathbb Z[x/2]\subset \mathbb Q[x]$.
But gcds in a PID D persist in extension rings because the gcd may be specified by the solvability of (linear) equations over D   and such solutions always persist in extension rings, see here.
A: Warning: you must specify the subring (which may be the whole ring)
relative to which the divisibility is defined.
Suppose that $R$ is a subring of an integral domain $S$,
and let $R^*$, $S^*$ denote the sets of nonzero elements of $R$ resp. $S$.
$\newcommand{\divides}{\mid}$
We say that $s\in S^*$ divides $s'\in S^*$ relative to $R$,
and write $s\divides_R s'$,
if there exists $r\in R^*$ such that $sr=s'$.
If $s,s'\in S^*$, then $s\divides_R s'$ and $s'\divides_R s$
if and only if $s'=su$ for some unit $u$ of $R$;
we write this (equivalence) relation as $s\sim_R s'$.
$\newcommand{\set}[1]{{\{#1\}}}$
For any $s_1,s_2\in S^*$ we denote by
$\gcd_R(s_1,s_2)$ a greatest lower bound (provided it exists)
of $\set{s_1,s_2}$ in the preordered set $(S^*,{\divides_R})$;
$\gcd_R(s_1,s_2)$ is determined only up to a factor in $R^\times$,
the group of units of $R$.
If the divisibility in your question means the divisibility relative to the whole ring,
both for $R$ and $S$, then the answer is no.
$\newcommand{\ZZ}{\mathbb{Z}}$
$\newcommand{\QQ}{\mathbb{Q}}$
For example, let $R=\ZZ$ and $S=\QQ$.
Then $\gcd_\ZZ(4,6)\sim_\ZZ 2\nsim_\ZZ 1$ in $(\ZZ,{\divides_\ZZ})$
and $\gcd_\QQ(4,6)\sim_\QQ 1$ in $(\QQ,{\divides_\QQ})$;
but we do have $\gcd_\ZZ(4,6)\sim_\ZZ 2\nsim_\ZZ 1$ in $(\QQ,{\divides_\ZZ})$.
(Added next day: actually this is not a counterexample -- se below.)
If the divisibility in your question is relative to $R$,
in $R$ as well as in $S$, then the answer is yes.
This fact is best proved in a more general context of GCD monoids,
since the additive structure in rings is immaterial for your question
-- actually it is a nuisance, always under our legs when we neither want it nor need it.
I will give you the proof tomorrow.
Continued. $~$WHOA! I gave a non-counterexample,
since also $\gcd(4,6)_\QQ\sim_\QQ 2$ because $2\sim_\QQ 1$ in $(\QQ,{\divides_\QQ})$.
Such is a life of a mathematician:
doing mathematics I am wasting great deal of time
getting myself into dead ends and then backing out of them,
and part of the time I am making mistakes, some of them unbelievably stupid.
I will let the mistake stay, it has a didactic value.
Now let me see if I understand your question.
We have a UFD $R$ which is a subring of an integral domain $S$.
If $r_1$, $r_2$ are any nonzero elements of $R$ with a GCD $d$ relatively to $R$,
then the question is whether $d$ is also a GCD of $r_1,r_2\in S$ relatively to $S$.
Am I right? Is this the question? Let us assume it is.
In the UFD $R$ every pair of elements has a GCD
(even when one of them, or both, are zero, since $\gcd_R(r,0)=r$ for every $r\in R$),
that is, $R$ is a GCD domain.
Nothing is said about the existence of GCDs for all pairs of elements of $S$;
however, the question does not ask this,
it just queries whether any two nonzero elements $r_1,r_2\in R\subseteq S$,
which we know have a GCD $d$ in $R$, have this same $d$ as a GCD in $S$.
This is indeed true if $R$ is a PID,
for in this case $d=r_1r_1'+r_2r_2'$ for some $r_1',r_2'\in R$;
if $c\in S$ is a common divisor of $r_1$, $r_2$ in $S$,
then $r_1=cs_1$ and $r_2=cs_2$ for some $s_1,s_2\in S$,
hence $d=c(s_1r_1'+s_2r_2')$, which shows that $c$ divides $d$ in $S$.
The additive structure of rings does have
a role in this case.
Here comes a genuine counterexample for an $R$ that is only a UFD, not a PID.
Let $X$, $Y$, $Z$ be formal variables,
and consider the rings $R:=\ZZ[X,Y]$ and $S:=\ZZ[X,Y,Z,XZ^{-1},YZ^{-1}]$;
$R$ is a UFD,
$S$ is an integral domain because it is a subring of the field $\QQ(X,Y,Z)$,
and $R$ is a subring of $S$.
We have $\gcd_R(X,Y)\sim_R 1$.
The elements $X$ and $Y$ of the ring $S$ have a common divisor $Z$ in $S$;
but $Z$ does not divide $1$ in $S$, thus $1$ is not a GCD of $X$ and $Y$ in $S$.
At this point it is already clear that we have a counterexample,
but we ask a related question: do $X$ and $Y$ have a GCD in $S$?
In principle it might happen that $\gcd_S(X,Y)$ would not exist;
but in our case $\gcd_S(X,Y)$ exists and is equal to (that is, it is $\sim_S$ to) $Z$
(you may enjoy proving this).
Ha! We do have a stronger question:
do there exist a UFD $R$ and an integral domain $S$ containing $R$ as a subring,
such that there are nonzero $r_1$, $r_2$ in $R$ that do not have a GCD in $S$
(this GCD is meant relatively to $S$)?
Right now I cannot see how I would construct an example.
About the promised proof in the context of GCD monoids:
this proof answers a question that you did not ask
(but which I mistakenly understood to be the question you are asking),
so I will not bother you with it.
(Added a little later.)
Here is an example for the related stronger question;
it is an evident extension of the counterexample for the original question.
Let $X$, $Y$, $U$, $V$ be formal variables,
and set $R:=\ZZ[X,Y]$, $S:=\ZZ[X,Y,U,V,X/U,Y/U,X/V,Y/V]$.
$~$If $e\in S$ is a common divisor of
$X$ and $Y$ in $S$,
then $e\sim_S 1$ or $e\sim_S U$ or $e\sim_S V$,
and the set $\set{1,U,V}$
does not have a greatest element in the preordered set $(S,{\divides_S})$.
A: Let $K$ be a field.
First note, that $K[X,Y] \cong K[X,XY]$, via $X \mapsto X, \, Y \mapsto XY$, so $\gcd_{K[X,XY]}(X,XY) = 1$. Now consider the canonical inclusion $\iota \colon K[X,XY] \hookrightarrow K(Y)[X]$. Obviously $\gcd_{K(Y)[X]}(X,XY) = X \not \sim_{K(Y)[X]} 1$. Note that $K[X,XY]$ is a UFD and $K(Y)[X]$ is even a PID.
