I am trying to prove the following: if $R$ is a PID and $Q$ is the field of fractions of $R$, then any element of $Q$ has an expression of the form $f/g$ where $(f,g)=(1)$. I proved the following: In a PID, if $x$ and $y$ have gcd $d$, then $(x,y)=(d)$ and there exists $a,b\in R$ such that $ax+by=d$ and $(a,b)=(1)$. Here is my work so far
Take any $x/y\in Q$. Since $R$ is a PID, we can find a gcd of $x$ and $y$ and write $(x,y)=(d)$, so that $fx+gy=d$ for some $f,g\in R$ and $(f,g)=(1)$. I claim that $x/y\sim f/g\iff gx=fy$ . This is where I am stuck. Any hints would be greatly appreciated.