Isomorphism of schemes over a DVR is determined by the isomorphism over its generic fiber? Let $R$ be a discrete valuation ring.
Let $X\to \operatorname{Spec} R$ and $Y\to \operatorname{Spec} R$ be separated (not necessarily proper) $R$-schemes which are flat over $\operatorname{Spec} R$.
Let $f: X\to Y$ a morphism of schemes over $\operatorname{Spec} R$, which induces an isomorphism on the generic fibers $f_{\eta}: X_{\kappa(\eta)}\to Y_{\kappa(\eta)}$, where $\eta$ is the generic point of $\operatorname{Spec} R$.
Question: Is it true that the original map $f: X\to Y$ is an isomorphism?
Remark: The answer is NO in this generality. In addition to the example in the comment by Notone, here is another example. Take $f=i: X=Y_{\kappa(\eta)}\to Y$ is the inclusion of the generic fiber of $Y$ in $Y$, then $f$ induces isomorphism on the generic fiber but $f$ itself is not an isomorphism.
Let me put more refined question:
In addition to above, assume that both $X$ and $Y$ are smooth over $\operatorname{Spec} R$ and $f: X\to Y$ is Nisnevich.
Then is $f$ an isomorphism?
In case it is true under these assumptions, is it possible to remove the smoothness assumptions?
Your comments are most welcome.
 A: I’m answering a weakening of the refined question. Let $f: X \rightarrow Y$ be a quasi-compact surjective étale map (so I think Nisnevich and quasi-compact is sufficient) of flat separated $R$-schemes that is an isomorphism on the generic fiber. Then $f$ is an isomorphism.
(Without quasi-compactness and surjectivity the relative diagonal is still an isomorphism, but I’m not sure what the exact scheme-theoretical consequence is – is it that $f$ is an immersion and therefore an open immersion?)
Indeed, $f$ is a fpqc cover, so it’s enough to show that the base change of $f$ by $f$ (aka the first projection $\pi: X \times_Y X \rightarrow X$) is an isomorphism.
Now, let $s: X \rightarrow X \times_Y X$ be the diagonal, it’s an open immersion (as $f$ is étale) and closed immersion ($X,Y$ are separated $R$-schemes so $X$ is separated over $Y$). Now, $X \times_Y X$ is a flat $R$-scheme so its generic fiber is dense, ie $s$ has dense closed image, so $s$ is a surjective open immersion hence an isomorphism. As $\pi \circ s$ is the identity, then $\pi$ is an isomorphism and we are done.
A: Question: "Let $f: X\to Y$ a morphism of schemes over $\operatorname{Spec} R$, which induces an isomorphism on the generic fibers $f_{\eta}: X_{\kappa(\eta)}\to Y_{\kappa(\eta)}$, where $\eta$ is the generic point of $\operatorname{Spec} R$. Is it true that the original map $f: X\to Y$ is an isomorphism? @hm2020 What is the map from A→B or B→A that you have in mind, which induces the isomorphism over the fraction field of R? In my question, there is a given map from X to Y over SpecR. – Evans Gambit"
Answer: Let $R$ be a DVR with quotient field $K$ and let  $A:=R[x_1,..,x_n]/I, B:=R[y_1,..,y_m]/J$ and assume $\phi: A \rightarrow B$ is a map of $R$-algebras with induced map
$$\phi_K:=1\otimes \phi: K\otimes_R A \rightarrow K\otimes_R B.$$
Assume $\phi_K$ has an inverse map of $K$-algebras $\psi_K$. By definition for any $y_j$ it follows
$$\psi_K(y_j)=\sum_I \alpha(j)_I x_1^{i(j)_1}\cdots x_n^{i(j)_n}$$
with $\alpha(j)_I =\frac{a(j)_I}{s(j)_I}\in K(R)$. Put $s:=\prod s(j)_I$ and $s^j_I:=\prod_{I, i\neq j}s(i)_I$. it follows
$$\frac{\alpha(j)_I}{s(j)_I}=\frac{\alpha(j)_I s^j_I}{s} \in R_s.$$
And you may write
$$\psi_K(y_j)=\frac{1}{s}\sum \alpha(j)_I s^j_I x_1^{i(j)_1}\cdots x_n^{i(j)_n} \in R_s[x_i]/I\cong R_s\otimes_R A \cong A_s.$$
Do this similarly with $\psi_K(g_j)$ for a set of generators of $J$ to arrive at an element $t\in R-(0)$ and a map
$$\psi_t: R_t\otimes_R B \rightarrow R_t \otimes_R A.$$
We also get a map
$$\phi_t: R_t\otimes_R A\cong  A_t \rightarrow R_t \otimes_R B\cong B_t$$
with the property that $\psi_t, \phi_t$ are inverses to each other. Hence the natural map $Spec(A_t) \cong Spec(B_t)$ is an isomorphism of schemes. This construction is valid for any $X,Y$ that are of finite type over $Spec(R)$.
You get a construction of two open subschemes $U \subseteq X, V \subseteq Y$  and an isomorphism $U \cong V$
of $R$-schemes. Hence if $X,Y$ are irreducible, an isomorphism at the generic point implies they are birational.
