Let $R$ be a dvr and $f : X\to S$ a universally closed morphism of $R$-schemes.
Assume $X$ and $S$ are $R$-flat and universally closed.



> 
> If the special fiber of $X\to S$ is a closed immersion, is $X\to S$ a closed immersion?
> 
> 
> 


**remarks**


* My guess is "no", but I'm looking for a counterexample (I can imagine something where $f$ crashes a locus contained in the generic fiber to a point).
* Namely, I expect "no" for an answer because I see no reason why $f$ should have to be a monomorphism (unless one also assumes $f$ is a closed immersion on generic fibers, which I am not assuming). I'd expect some example such that for some $s\in S$ the fiber $f^{-1}(s)$ is nonempty and larger than $\kappa(s)$-point.
* I can believe $f$ is unramified. What I expect should fail is the monomorphism part.
* A silly example of a map that is a monomorphism on special fibers but not globally a monomorphism can already be, calling $K$ the fraction field of $R$ $$f : \text{Spec}(K)\coprod \text{Spec}(R) \to\text{Spec}(R)$$
induced by the ring map $R\to R\times K$, the identity on the first factor and the inclusion on the second. Clearly $f$ is the identity (hence a closed immersion) on special fibers, but it is not a monomorphism globally since the fiber over the generic point $\eta\in\text{Spec}(R)$ is two copies of $\eta$ and not one.
* **What I'm looking for** is a neat non-silly example of a geometric flavor (say $X$ and $S$ connected, of dimension $\ge 2$, perhaps $f$ of relative dimension $\ge 1$ with geometrically connected fibers). In the first example above $\text{Spec}(K)\coprod\text{Spec}(R)$ is not universally closed, so this is not an example directly relevant to the question. The second example above, if correct, should answer the question in the negative, as expected. I'd prefer some example for which one can (at least generically) "draw a picture".



Detecting closed immersions on fibers
I am just posting my comment as an answer, mostly to correct the mistake identified by @LaurentMoret-Bailly.


The property of being universally closed depends only on the underlying reduced scheme. Thus, there are counterexamples coming from a nilradical that is quasi-coherent, yet not coherent.


For one example, let $S$ be $\text{Spec}(R)$ and let $X$ be Spec of the $R$-algebra $R\oplus \text{Frac}(R)x$, where $x^2$ is zero. The morphism from $X$ to $S$ is a universal homeomorphism, thus universally closed. The morphism of closed fibers is an isomorphism, hence it is a closed immersion. Yet the morphism of generic fibers is projection from the dual numbers over Spec of $\text{Frac}(R)$, and this is not a closed immersion.


