# quotient of integral polynomials not being integral

So let $R$ be an integral domain and $K$ its fraction field. Let $f,g,h\in K[x]$ be 3 monic polynomials such that $f=gh$. So I would like to have a simple example of a ring $R$ for which one has that $f,g\in R[x]$ but $h\notin R[x]$.

P.S. May be working with an non-maximal order of a Dedekind ring is good enough. Nevertheless I could not come up with such an example

-

We show that $h$ must be in $R[x]$. Suppose that we have polynomials
$$g = x^n + a_1x^{n-1} + ... + a_n \in R[x]$$ $$h = x^m +b_1x^{m-1} + ... + b_m \in K[x]$$ such that $f = gh \in R[x]$ but $h \notin R[x]$. Let $r:= \min \{i \mid b_i \notin R\}$. Since $f \in R[x]$ we have $b_r + a_1b_{r-1} + ... + a_{r-1}b_1 + a_r \in R$, so $b_r \in R$. It is a contradiction.
I don't think this can happen. The division algorithm works over arbitrary rings, with unique quotient and remainder, as long as you are dividing by a monic polynomial. This implies that if $g$ is monic and divides $f$ in $K[x]$, it also divides it in $R[x]$, and $h$ must be the quotient in both rings.