Let $R$ be a UFD and let $F=\text{Frac}(R)$. Let $f\in R[x]$ be a monic polynomial. Show that if $f$ has a root in $F$ then $f$ has a root in $R$.
Attempt:
Suppose $f$ has a root $a\in F$. $R$ is a UFD then $\exists c,d\ne0$ with $a={c\over d}$ and $\gcd(c,d)=1$.
Suppose $f(x)=a_0+a_1x+\dots+a_{n-1}x^{n-1}+x^n$. Then we have $$ 0=f({c\over d})=a_0+\dots+a_{n-1}{c^{n-1}\over d^{n-1}}+{c^n\over d^n} \\={1\over d^n}(a_0d^n+\dots+a_{n-1}c^{n-1}d+c^n) $$ $R$ is an integral domain so $$ 0=a_0d^n+\dots+a_{n-1}c^{n-1}d+c^n\Rightarrow \\c^n=-d(a_0d^{n-1}+\dots+a_{n-1}c^{n-1})\Rightarrow d|c^n $$ But $d\nmid c$. Let $k$ be the minimal s.t. $d|c^k$.
How can I proceed? Thanks!