# Fiberwise isomorphic condition open or closed?

Let $$X\to Z$$ and $$Y\to Z$$ be two (flat and projective) families over $$Z$$, and let $$W\subset Z$$ be the subscheme on which the fibers of the two families are isomorphic. Then, is $$W$$ an open or closed subset of $$Z$$? (or neither)

You can't guarantee either. Any projective flat family $$X\to Y$$ which has some proper closed non-open subvariety $$Z\subset Y$$ so that the fibers over $$Y\setminus Z$$ and $$Z$$ are not isomorphic will give a counterexample to both statements. Why? Pick $$y_1\in Z$$ and $$y_2\notin Z$$, then $$Y\times f^{-1}(y_1)\to Y$$ and $$Y\times f^{-1}(y_2)\to Y$$ are both flat and projective but agree with $$X\to Y$$ on a closed and not open and open not closed subscheme, respectively.
Here is one such family. Let $$Y=\operatorname{Spec} k[t]$$ and $$X=\operatorname{Spec} k[t,u]/(u^2-t)$$ with the map being $$\operatorname{Spec}$$ of the map $$k[t]\to k[t,u]/(u^2-t)$$ by $$t\mapsto t$$. This is a finite flat map of rings, since the target is a free module with basis $$\{1,u\}$$, thus it is a projective and flat map of schemes. But the fibers over nonzero points are not isomorphic to the fiber over $$0$$, since the former are reduced and the latter is not.