When irreducible elements of a UFD remain irreducible in a ring extension

Solution 1:

This does not force $D$ to be a UFD as you originally asked, here is a counterexample. Take $U = \mathbb{Z}_{(2)}$ and $D = \mathbb{Z}_{(2)}[X]/(X^2 - 8)$. Then $U$ is a DVR and its only non-zero prime is $(2)$.

An easy computation shows that all units in $D$ are $a + bX$, where $a$ is a unit in $U$. Using this it is not hard to show that $2$ remains irreducible.

But clearly we have $$ 2^3 = 8 = X \cdot X $$ in $D$, showing that $D$ is not a UFD.