Flat essential ring extensions We call a ring extension (where $R$ and $S$ are commutative) $R \subset S$ essential if for every ideal $I$ of $S$ we have
that $I \cap S \neq 0 \implies I \cap R \neq 0$.
Suppose now that $R \subset S$ is an extension that is flat. Can we find a ring homomorphism $S \to T$ such that the composite $R \to S \to T$ is an essential extension that is also flat?
 A: Edit: I have added some additional remarks to the answer below.
As already mentioned, when $R$ is a domain and $S$ is a flat overring, we can find $S \to T$ such that $T$ is an overring of $R$ which is both flat and essential over $R$. Indeed, if $S$ itself is not essential over $R$, by Zorn's Lemma it has an ideal $I$ that is $\subseteq$-maximal with respect to $I \cap R$ $=$ $0$. Because $R$ is an integral domain, $I$ is a prime ideal of $S$. Then $T$ $=$ $Q(S/I)$, the quotient field of $S/I$, is clearly essential over $R$. It is easy to verify that $T$ is flat over $R$ by means of the following criterion, which appeared as exercise 22 to Ch.I, §2 of Bourbaki's Commutative Algebra and is often useful when it comes to flatness. For, let $\mathfrak{a}$ $\le$ $R$ $\ni$ $a$ and $t$ $\in$ $T$ such that $at$ $\in$ $\mathfrak{a}T$. If $a$ $\in$ $I$ then $a$ $=$ $0$, so that $(\mathfrak{a}:a)$ $=$ $R$. And if $a$ $\notin$ $I$ then $a$ is a unit in $T$, and hence $t$ $\in$ $\mathfrak{a}T$ $\subseteq$ $(\mathfrak{a}:a)T$.
Lemma: a module $M$ over a commutative ring $A$ is flat iff for every $a\in A$ and every ideal $\mathfrak{a}$ of $A$ one has $(\mathfrak{a}M:a)$ $=$ $(\mathfrak{a}:a)M$. Here, $(\mathfrak{a}M:a)$ $=$ $\{x\in M$ $\mid$ $ax\in \mathfrak{a}M\}$ and $(\mathfrak{a}:a)$ $=$ $\{b\in A$ $\mid$ $ab\in \mathfrak{a}\}$. So this comes down to: if $ax\in \mathfrak{a}M$ then $x$ $=$ $by$ for some $y\in M$ and $b\in A$ with $ab$ $\in$ $\mathfrak{a}$.
Proof: if $M$ is flat, then $0 \to A/(\mathfrak{a}:a) 
\xrightarrow{a\cdot} A/\mathfrak{a}$ remains exact after tensoring with $M$. That is, $0 \to M/(\mathfrak{a}:a)M \xrightarrow{a\cdot} M/\mathfrak{a}M$ is exact. For the converse, it suffices to show that for every ideal $\mathfrak{a}$ of $A$, the natural map $\mathfrak{a} \otimes_A M \to \mathfrak{a}M$ is injective. Let $\vartheta$ $=$ $\sum_{i=1}^n a_i\otimes x_i$ with $\sum_{i=1}^n a_ix_i$ $=$ 0 (where $a_i$ $\in$ $\mathfrak{a}$ and $x_i$ $\in$ $M$). We will rewrite $\vartheta$ as the sum of $n-1$ tensors. By induction, $\vartheta$ will then be equal to the empty sum of tensors, that is: to zero. Putting $\mathfrak{b}$ $=$ $\sum_{i=1}^{n-1} a_iA$, we have $x_n$ $\in$ $(\mathfrak{b}M:a_n)$ $=$ $(\mathfrak{b}:a_n)M$, so that $x_n$ $=$ $by$ for suitable $y$ $\in$ $M$ and $b$ $\in$ $A$ for which we can write $a_nb$ $=$ $\sum_{i=1}^{n-1} a_ic_i$ with the $c_i$ $\in$ $A$. Then $a_n \otimes x_n$ $=$ $a_n \otimes by$ $=$ $a_nb \otimes y$ $=$ $(\sum_{i=1}^{n-1} a_ic_i) \otimes y$ $=$ $\sum_{i=1}^{n-1} a_i \otimes c_iy$, and hence $\vartheta$ $=$ $\sum_{i=1}^{n-1} a_i \otimes (x_i+c_iy)$, $\square$.
(Note that one can even limit oneself to considering only finitely generated ideals $\mathfrak{a}$.)
Here is a counterexample in the case of non-domains. Let $R=\mathbb{F}_2[x]/(x^2)$. Using the Lemma, one sees that an $R$-module $M$ is flat over $R$ iff $\ker(x\cdot:M\to M)$ $=$ $xM$. So the overring $S$ $=$ $(R[y]/(y^2-x))_{(x,y)}$ is flat over $R$. If $I$ denotes the non-zero ideal $xyS$ of $S$, one has $I\cap R$ $=$ $0$, and the ideal $I$ is maximal with respect to this property. (The residue classes of $S$ modulo $I$ have representatives 1, $x$, $y$ and $x+y$. Adding $x$ $+$ $y$ to the ideal yields $xy$ $+$ $y^2$ $=$ $xy$ $+$ $x$, so that 0 $\ne$ $x$ will be in the ideal. The same goes when $1$, $x$ or $y$ is added to $I$, of course.)
Assume $S\to T$ is an $S$-algebra such that $R\rightarrowtail T$ and $T$ is flat and essential over $R$. Then $IT$ is an ideal of $T$. If $IT$ $=$ $0$, we have $xy=0$ in $T$, so $y=xt$ for some $t\in T$, because $T$ is $R$-flat. But then $x=y^2=x^2t^2=0$ in $T$, contradicting $R\rightarrowtail T$. And if $IT$ $\ne$ $0$ then, by essentiality, $0$ $\ne$ $IT\cap R$ $=$ $IT\cap S\cap R$. Since $I\cap R$ $=$ $0$, this means that $IT\cap S\supsetneq I$. So one of the elements $1,x,y$ and $x+y$ of $S$ must be in $IT$. But one easily checks that if $s$ is any of these four, having $s=xyt$ for a $t\in T$ implies $x=0$ in $T$. (E.g., if $x+y=xyt$, then $0$ $=$ $x^2t$ $=$ $xy^2t$ $=$ $xy+y^2$ $=$ $xy+x$, so $x$ $=$ $xy$, and therefore $x$ $=$ $xy^2$ $=$ $x^2$ $=$ $0$.)
Notice that $R$ is local and noetherian, and even artinian.
Edit2: In the case that $R$ is a domain, the proof did not even use the fact that $S$ is flat over $R$. The statement is therefore likely to be capable of some generalization, though not to a great extent. For when $S$ is not essential over $R$, you will need to pass to a quotient of $S$ first, and this does not sit well with preserving flatness. The statement obviously also holds when $R$ is VNR (Von Neumann regular, i.e. every $R$-module is flat). A common generalization of domains and VNR rings is formed by the class of pp rings (principal ideals of $R$ are projective as $R$-modules). If $R$ is pp and $a$ $\in$ $R$, then $\mathrm{ann}_R(a)$ $=$ $eR$ for an idempotent $e$ of $R$ (this characterizes pp rings). One can write $R$ $=$ $R_e \times R_{1-e}$, and $a$ becomes zero in $R_e$ and regular (not a zero divisor) in $R_{1-e}$. Every $R$-module $M$ $=$ $M_e \times M_{1-e}$. In particular, this holds for ideals of $R$ and of $R$-algebras. The category of $R$-modules is simply the product of the category of $R_e$-modules and that of the $R_{1-e}$-modules, and properties merely have to be verified on both "sides" independently. Again take $I$ $\leq$ $S$ maximal with $I \cap R$ $=$ $0$, and let $T$ $=$ $Q(S/I)$, the total ring of quotients of $S/I$. To see that $T$ is flat over $R$, let $\mathfrak{a}$ $\leq$ $R$, $a$ $\in$ $R$, and $t$ $\in$ $T$ such that $at$ $\in$ $\mathfrak{a}T$. We may assume that $a$ is either zero or regular in $R$. If $a$ $=$ $0$, then $(\mathfrak{a}:a)$ $=$ $R$, so that $t$ $\in$ $(\mathfrak{a}:a)T$. And if $a$ is regular in $R$, it remains regular in $S/I$. For assume that $as$ $\in$ $I$ for an $s$ $\in$ $S$ with $s$ $\notin$ $I$. Then $(sS+I) \cap R$ $\ne$ $0$, so we have $0$ $\ne$ $b$ $=$ $ss_1+i$ $\in$ $R$ for an $s_1$ $\in$ $S$ and an $i$ $\in$ $I$. But then $0$ $\ne$ $ab$ $=$ $ass_1+ai$ $\in$ $I \cap R$, contradiction. Therefore, $a$ is a unit in $T$, and hence $t$ $\in$ $\mathfrak{a}T$ $\subseteq$ $(\mathfrak{a}:a)T$. Again, flatness of $S$ never enters into it, which makes one wonder whether that assumption is ever helpful at all for the problem at hand.
