Given a UFD $R$, and $F = \mathrm{Frac}(R)$, we can define the content of a polynomial $f\in F[X]$, $f = a_nX^n + \cdots + a_1X + a_0$, by $c(f) = \prod_{p \in \mathcal P} p^{v_p(f)}$, where $v_p(f) = \min_{0 \leq i \leq n} v_p(a_i)$ are the valuations and $\mathcal P$ is the set of all primes in $R$.
I've been told that if $c(f) = 1$, then $f \in R[X]$, but I'm unsure how to show this.
I'm trying to show that the coefficients $a_i$ of the polynomial are in $R$. The condition $c(f)=1$ tells me that no prime $p$ divides all the coefficients of $f$, but I don't know how this helps?
Intuitively I gather that no prime $p$ appears in any of the denominators of $a_i \in \mathrm{Frac}(R)$ because $v_p(f) = 0 $ for all primes $p$, and so the coefficients must be in $R$. But this is hardly rigorous?
$c(f)=1$ means $v_p(f)=1$ for all primes $p$, and this implies $v_p(a_i)\ge 0$ for all $p$ and all $i$. So all the $a_i$ are in $R$.
In fact, $c(f)$ is the $\gcd$ of the $a_i$.