Theorem. Let $R$ be a UFD, $f \in R[X]$ a monic polynomial and $\alpha$ is in the field of fractions of $R$. Then if $f(a)=0$, $a \in R$.
What I have done: Let $f= x^n +a_{n-1}x^{n-1}+\dots+ a_0 $ and $\alpha = a/b $, then since $R$ is a UFD, we can factorize $a$ and $b$. After cancelling out the common factors let us say $\alpha=u/v$. $f(\alpha)=0 \implies \cfrac{u^n}{v^n} +\dots +a_1\cfrac{u}{v}+a_0 =0$. Multiply both sides by $v^n;$
$$u^n +a_{n-1}u^{n-1}v + \dots +a_1uv^{n-1} +a_0v^{n}=0.$$
Now I am stuck, how should I continue? Can I say that $u$ is algebraic over $R[\alpha]$ for instance?
You're just there.
If $d$ is an irreducible divisor of $v$, then $d$ will divide all the terms of your last equation except for the leading $u^n$ and only that one, which is a contradiction (unless $d$ is a unit). Hence, $v$ is a unit.