I'm having trouble coming up with a counterexample for the following (I'm not interested in a full solution, rather I want ideas/hints):
(*) For an injective homomorphism of rings $\phi:R \rightarrow S$, $S$ a unique factorization domain. Suppose $R$ is a unique factorization domain but not a principal ideal domain. Then if $\delta$ is the greatest common divisor for non-zero $x,y \in R$, then $\phi(\delta)$ is a greatest common divisor for $\phi(x)$ and $\phi(y)$ in $S$.
I've proved this to hold for when $R$ is a PID, but I'm not sure if I have the right intuition as to why this is even the case.
Any hints to get me on the right track would be appreciated, such was what ring $R$ to consider and why (*) holds in the case where $R$ is a PID.
Hint: start in $S$. Find an example of two elements with a nontrivial $\gcd$. Then create $R$ in such a way that it has the two elements, but not the $\gcd$ you found. A ring $R$ to consider in the spoiler.