Let $A \subseteq A[w] \subseteq C$ be three Noetherian integral domains, over a field $k$ of characteristic zero, with $A \subseteq C$ an algebraic ring extension (in particular, $w$ algebraic over $A$).


Further assume that: **(1)** $A$ and $C$ are unique factorization domains (UFD's).


**(2)** $A \subseteq C$ is root closed, namely, for all $n$, if $c \in C$ satisfies $c^n \in A$, then $c \in A$.


**(3)** $w$ is an irreducible element of $C$ (hence it is also an irreducible element of $A[w]$). Notice that, since $C$ is assumed to be a UFD, the assumption that $w$ is irreducible in $C$ implies that it is prime in $C$
(but it can be non-prime in $A[w]$).


**(4)** $w$ is a prime element of $A[w]$. 



> 
> Is it true that $A[w]$ must be a UFD? Or, is there a counter-example?
> 
> 
> 


**Remark:** Without assuming (2),(3),(4) it is easy to find a counter-example:
$k[t^2] \subset k[t^2][t^3] \subset k[t]$ ($w=t^3$). Clearly, $k[t^2]$ and $k[t]$ are UFD's, but $k[t^2][t^3]$ is not a UFD, since $t^3$ is an irreducible element of $k[t^2][t^3]$ which is not prime: $t^3t^3=t^2t^2t^2$.


Somewhat relevant questions are: [1](https://mathoverflow.net/questions/269516/characterizing-all-simple-algebraic-ring-extensions-of-mathbbcx-having-no), [2](https://math.stackexchange.com/questions/2276356/a-simple-algebraic-ring-extension-of-a-ufd-having-no-prime-elements).


**Edit:** After receiving a nice counter-example to my original question, it would be nice to know which additional conditions are required in order to guarantee that $A[w]$ is a UFD; for example:


(i) Finding a special form of the minimal polynomial of $w$ over $A$.


(ii) Additional properties of the ring extension $A \subseteq C$, such as flatness/separability (I am not sure I know whether the counter-example is flat/separable or not).


(iii) The only invertible elements of $C$ are $k^\*$ (this is clearly not satisfied by the counter-example).



Sandwich theorem for UFD's
That is not true. Let $A$ be a polynomial ring in two variables, $k[s,t]$. Let $C$ be the $A$-subalgebra of the fraction field generated by the fraction $s/t$, i.e., $C=k[(s/t),t]$. Both $A$ and $C$ are unique factorization domains (roughly by Gauss's Lemma). Since $A$ is integrally closed in its fraction field, the extension $A\to C$ is "root closed".


Let $w$ be the element $(s/t)^2-t$, just for one example. Then the $A$-algebra $A[w]$ equals $k[s,t][w]/\langle t^2w + (t^3-s^2) \rangle$. The quotient of $A[w]$ by the principal ideal generated by $w$ equals $k[s,t]/\langle t^3-s^2 \rangle$. This is an integral domain. Thus, the principal ideal generated by $w$ in $A[w]$ is a prime ideal. Of course $w$ is prime, hence irreducible, in $C$ since $C/\langle w\rangle$ is the polynomial ring $k[s/t]$. 


Finally, $A[w]$ is not a unique factorization domain. In fact, it is not even integrally closed in its fraction field. The element $f=s/t$ of the fraction field satisfies the monic polynomial, $$f^2 -(w+t) = 0.$$ If $f$ were an element of $A[w]$, then $A[w]$ would equal all of $C$. However, $A[w]/\langle w \rangle$ equals $k[s,t]/\langle t^3-s^2\rangle$. This is not regular, it is not a unique factorization domain, it is not integrally closed in its fraction field, etc. On the other hand, $C/\langle w \rangle$ is isomorphic to $k[s/t]$. This is regular, it is a unique factorization domain, it is integrally closed in its fraction field, etc.


**Edit.** The OP asks for a different example. In the following example, both $A\to A[w]$ and $A\to C$ are finite and flat. Both $A$ and $C$ are regular Noetherian integral domains. Yet $A[w]$ is not even integrally closed in its fraction field, because it fails the condition $R1$ of Serre's criterion. That is the common feature of both examples: a very singular scheme can be "sandwiched" between two smooth schemes. Once you understand the geometric nature of these examples, you can produce many other examples for yourself.


Let $n\geq 5$ be an integer that is prime to the characteristic. Let $A$ be $k[s\_1,\dots,s\_n]$, a polynomial ring in $n$ variables. Define $C$ to be the following $A$-algebra, $$C = A[x]/\langle p\_n(x) \rangle, \ \ p\_n(x) = x^n - s\_1x^{n-1} + \dots + (-1)^{n-m}s\_mx^{n-m} + \dots + (-1)^ns\_n.$$ The equation $p\_n(x)$ allows us to "eliminate" $s\_n$, so that $C$ is isomorphic to $k[s\_1,\dots,s\_{n-1},x]$, a polynomial ring in $n$ variables. Thus, both $A$ and $C$ are Noetherian, regular, integral domains of dimension $n$. By construction, $C$ is a finite flat extension of $A$ of rank $n$ as an $A$-module.


Now let $v$ be $s\_nx$ in $C$. Let $w$ be $v-s\_1$. Thus, the $A$-subalgebra $A[w]$ of $C$ equals the $A$-subalgebra $A[v]$. The element $v$ satisfies the monic polynomial equation $q\_n(v)=0$, $$q\_n(v) = v^n-s\_1s\_n^1v^{n-1} + \dots + (-1)^{n-1}s\_{n-1}s\_n^{n-1}v + (-1)^ns\_n^n.$$ By direct computation, for a variable $y$, the ring $B=A[y]/\langle q\_n(y) \rangle$ is a complete intersection ring that a finite, flat extension of $A$, and whose singular locus is an irreducible closed subset of the spectrum with associated prime ideal $\langle s\_n,v\rangle$. Since $A\to B$ is finite and flat, every irreducible component of $\text{Spec}(B)$ dominates $\text{Spec}(A)$. However, after inverting $s\_n$, the natural map $B[1/s\_n]\to C[1/s\_n]$ is an isomorphism. Hence, $B$ is generically reduced and has a single irreducible component. Since $B$ is a complete intersection ring, it is everywhere reduced. Thus $B$ is an integral domain, hence embeds in its fraction field. Therefore, since the map of fraction rings, $B[1/s\_n]\to C[1/s\_n]$, is injective, also $B\to C$ is injective. In conclusion, the natural map $B\to A[v]$ is both injective and surjective, hence an isomorphism. 


Note that $B$ is not integrally closed in its fraction field. Of course we can find a specific fraction that satisfies a monic equation yet is not in $B$. However, it is faster to use Serre's Criterion. Since $B$ is a complete intersection ring, it is Cohen-Macaulay, and thus it is $S2$. Therefore $B$ is integrally closed in its fraction field if and only if $B$ is $R1$. However, the singular locus of $B$ is the irreducible closed subset with coordinate ring $$B/\langle v,s\_n \rangle = A/\langle s\_n \rangle \cong k[s\_1,\dots,s\_{n-1}].$$ This has dimension $n-1$. So $B$ is singular in codimension $1$, thus it is not $R1$. Since $B$ is not integrally closed in its fraction field, by Gauss's Lemma, $B$ is also not a unique factorization domain.


The fraction field extension $\text{Frac}(A)\to \text{Frac}(C)$ is a degree $n$ extension whose associated Galois group is the full symmetric group $\mathfrak{S}\_n$. In particular, for $n\geq 5$, this cannot be a solvable extension, much less a radical extension. Thus, $\text{Frac}(A)$ is "radically closed" in $\text{Frac}(C)$. Since $A$ is integrally closed in its fraction field (by Gauss's Lemma again), also $A$ is "radically closed" in $\text{Frac}(C)$. 


The quotient ring $C/\langle w \rangle$ is $$k[s\_1,\dots,s\_{n-1},x]/\langle r\_n \rangle, $$ $$r\_n = (1-x^n)s\_1 + x^{n-1}s\_2 - x^{n-2}s\_3 + \dots + (-1)^{n}x^2s\_{n-1} + x^{n+1}. $$ By the Jacobian criterion, this ring is smooth over $k$. Moreover, the ring extension $k[x]\to C/\langle w \rangle$ is an affine space bundle (over $D(x)$, resp. $D(1-x^n)$, it is trivialized). Thus, it is irreducible of dimension $n-1$. Since the quotient ring is regular of dimension $n-1$, the ideal $wC$ in $C$ is a prime ideal. Therefore $w$ is a prime element of $C$.


The argument that $B/\langle w \rangle$ is integral of dimension $n-1$ is similar, but slightly more involved. The quotient ring is $$B/\langle w \rangle = k[s\_1,\dots,s\_{n-1}]/\langle g\_n \rangle,$$ $$g\_n = (1-s\_n)s\_1^n + s\_1^{n-2}s\_ns\_2 + \dots + (-1)^{n-1}s\_1s\_n^{n-1}s\_{n-1} + (-1)^ns\_n^n.$$ By the Jacobian criterion, the singular locus comes from the prime ideal $\langle s\_1,s\_n \rangle$. So the ring is reduced. Moreover, the ring extension $k[s\_1,s\_{n-1}] \to B/\langle w \rangle$ is flat of relative dimension $n-3$ away from $\langle s\_1, s\_{n-1}\rangle$, with the fiber over $\langle s\_1,s\_{n-1}\rangle$ of dimension $n-2$. Since a closed subset of dimension $n-2$ cannot be an irreducible component of the complete intersection ring $B/\langle w \rangle$ of dimension $n-1$, it follows that every fiber dominates $\text{Spec}k[s\_1,s\_{n-1}]\setminus \langle s\_1,s\_{n-1} \rangle$. The restriction over this open set is again an affine space bundle, hence it is irreducible. Therefore, since $B/\langle w \rangle$ is reduced and irreducible, the element $w$ of $B$ is prime. 


I want to emphasize once more the geometric nature of the example. You have a number of hypotheses -- "radically closed", prime element in $B$, etc. These are "generically" satisfied. So if you write down a family of complete intersection rings that fail $R1$ yet are sandwiched between factorial rings, "typically" all of your hypotheses should hold. In the example above, both $A\to B$ and $A\to C$ are finite and flat. So neither finiteness nor flatness are the issue. The issue is that you can "pinch" $C$ to make a complete intersection ring that is not $R1$.


