I am trying to follow a general version of the Eisenstein's criterion, which states that
Let $R$ be a commutative ring and $\mathfrak{p}$ a prime ideal of $R$. Let $$f = a_0 + a_1x + \dots + a_nx^n \in R[x] \, . $$ be such that
- $a_n \notin \mathfrak{p}$;
- $a_0, \dots, a_{n-1} \in \mathfrak{p}$;
- $a_0 \notin \mathfrak{p}^2$.
Then $f$ is not a product of polynomials of degree less then $n$ in $R[x]$.
A crucial step in the proof states that if $f = a_nx^n$ and $f = gh$, where $f, g, h \in R'[x]$ for some integral domain $R'$ (in this case, $R' = R / \mathfrak{p}$), then $g$ and $h$ must also be monomials. I do not see how it follows.
I do know that it holds if $R'[x]$ is a UFD, as then $R'[x]$ is a UFD and $f$ would have a unique factorization.