Let $R\subset K$ be principal ideal domains. If $a,b$ are nonzero elements of $R$, prove that $I=J\cap R$, where $I$ and $J$ denote the ideals generated by $a,b$ in $R$ and $K$, respectively.
Showing $I\subseteq J\cap R$ is easy. I'm struggling with the other inclusion. It's easy to show that $J\cap R$ is an ideal in $R$. Since $R$ and $K$ are PID's, let $I=Rx$, $J\cap R=Ry$, and $J=Kz$. Then $x$ divides $y$ in $R$. Now, $x$ will be a greatest common divisor of $a$ and $b$ in $R$ (I think), and $z$ will be a greatest common divisor of $a$ and $b$ in $K$, so since $R\subset K$, it follows that $x|z$ in $K$. So altogether, we have $y|x|z$ in $K$.
Let $\beta\in J\cap R$. Then $\beta=ry$ for some $r\in R$, but since $J\cap R=Kz\cap R$, we also have $\beta=kz$ for some $k\in K$. Because $x|z$ and $y|z$ in $K$, there exist $k_1,k_2\in K$ such that $z=k_1x$ and $z=k_2y$. Then $\beta=kk_1x=kk_2y=ry$. Since $y|x$ in $R$, we may write $x=r_1y$ for some $r_1\in R$, so $kk_1r_1y=kk_2y=ry$. In the integral domain $K$ this implies $kk_1r_1=kk_2=r$.
I can't figure out anything further. I think another statement that if shown would yield the desired result is that if $k_1a+k_2b\in R$ for some $k_1,k_2\in K$, then $k_1a+k_2b=r_1a+r_2b$ for some $r_1,r_2\in R$. Again, I don't understand why.
This statement is false as given.
E.g. let $R = \mathbb Z$, let $K = \mathbb Z[1/2]$ (or $\mathbb Q$, for that matter, but just in case you don't count a field as a PID, let me take $\mathbb Z[1/2]$ to be safe), and let $a = b = 2$. Then $I = 2 \mathbb Z$, $J = K$, and so $J \cap R = R$ is bigger than $I$.
One additional assumption that will make the statement true is if you assume that $K$ is an integral extension of $R$.