TITLE: faithfully flat ring extensions where primes extend to primes
QUESTION [11 upvotes]: I am interested in unital ring homomorphisms (and classes thereof) $R \rightarrow S$ of commutative rings that have the following pair of properties: 

$S$ is faithfully flat as an $R$-module, and
For any prime ideal $P$ of $R$, $PS$ is a prime ideal of $S$.

I know of the following examples:

$R \rightarrow R[X]$, where $X$ is an indeterminate over $R$ (or any set of algebraically independent indeterminates over $R$)
$R \rightarrow R[[X]]$, where $X$ is an analytic indeterminate over $R$ (or any finite set of such)
If $R$ is a field, take any (unital) ring map $R \rightarrow S$ such that $S$ is an integral domain.
If $R$ is a Noetherian valuation domain, the map $R \rightarrow \hat{R}$ will work.
Whenever $g: R \rightarrow S$ is an example of this and $W$ is a multiplicatively closed subset of $S$ such that $m S_W \neq S_W$ for any maximal ideal $m$ of $R$, then the induced map $R \rightarrow S_W$ works as well.  (Some other localizations will be fine too.)

Then there are cases that sometimes work.  For instance, one might expect $R \rightarrow \hat{R}$ to work, where $(R,m)$ is an arbitrary Noetherian local ring and $\hat{R}$ is its $m$-adic completion.  (As noted above, this works for valuation rings.)  However, it only works when $R/p$ is analytically irreducible for every prime ideal $p$ of $R$.  It fails, for instance, when $R$ is the localization of $k[x,y]$ at $(x,y)$ when $k$ is a field of characteristic other than $2$.  (This is because the element $x^2-y^2-y^3$ is prime in $R$ but not in $\hat{R}$.)
Do people know of any other important examples?

REPLY [4 votes]: This question might be easier to consider geometrically.
You want the morphism $\operatorname{Spec}S \to \operatorname{Spec}R$ to be faithfully flat, and the fibre over each point $\mathfrak p \in \operatorname{Spec}R$ (which equals $\operatorname{Spec}S\otimes_R \kappa(\mathfrak p)$, where $\kappa(\mathfrak p)$ 
is the residue field of $R/\mathfrak p$) should be integral.
(Actually, the question asks that $S/\mathfrak p S$ be integral,
but since $S$ is flat over $R$ by assumption, the embedding $R/\mathfrak p \hookrightarrow \kappa(\mathfrak p)$
induces an embedding $S/\mathfrak p S \hookrightarrow S\otimes_R \kappa(\mathfrak p).$ Thus if the target is a domain, so is the source,
and conversely, since the target is a localization of the source.)  
So for example, any smooth morphism of affine varieties all of whose fibres are connected will give an example. (Since a smooth connected variety is irreducible.)
This will give an enormous class of examples.
E.g.
as a slight variation on the preceding remark, let $k$ be an algebraically closed field, and let $A \subset B$ an inclusion of f.g. $k$-algebras that are domains, such that, if $K$ denotes
the algebraic closure of $\operatorname{Frac}(A)$, then $K\otimes_A B$ is a domain.
(In other words, the generic fibre of the map $\operatorname{Spec}B \to \operatorname{Spec}A$ is geometrically irreducible.)  Then over some non-empty open subset of $\operatorname{Spec}A$ the restriction of $\operatorname{Spec}A \to\operatorname{Spec}B$ will be faithfully flat
and will have geometrically irreducible fibres, and hence
we can find $a \neq 0$ such that $A[1/a] \to B[1/a]$ will have the desired property.
A concrete example is given by the inclusion
$\mathbb C[t] \subset \mathbb C[x,y,t]/(y^2 - x(x-1)(x-t)),$
but there is nothing particularly special about this example;
it is just my favorite example of a flat family of irreducible
curves.  
Added: This is an example taken from the discussion in comments below.  It
is intended to illustrate why the above example is not particularly special or limited in scope.
Let $A$ be any f.g. $k$-algebra, and let $f(x_1,\ldots,x_n)$ be a polynomial
whose coefficients are elements of $A$, i.e. $f \in A[x_1,\ldots,x_n]$.
Now consider the ring $B = A[x_1,\ldots,x_n]/(f)$.
Geometrically, $f$ is the equation for a family of hypersurfaces, parameterized by $\operatorname{Spec}A$.
Again, suppose that $A$ is a domain (so $\operatorname{Spec}A$ is a variety), and let $a \in A$ be the discriminant of $f$.  Unless you are very unlucky
in your choice, $a$ will be non-zero. (Geometrically, this is saying that
the family of hypersurfaces $f=0$ doesn't have every member being singular.  Of course it could, if you chose it that way, but if you choose it generically, then it won't.)  So if we pass to $A[1/a]$ and $B[1/a]$, we have a family of smooth hypersurfaces. Provided that $n \geq 2$, a smooth hypersurface is irreducible, so $A[1/a] \subset B[1/a]$ will satisfy the conditions of the problem.
[In the  example with cubic curves, I didn't invert the discriminant, because I happened to choose a flat family of curves which remain irreducible even when they become singular.]