Morphism between thick fibers of schemes extends to a neighbourhood Let $ S $ be a locally Noetherian scheme, and $ X $, $ Y $ finite type $ S $-schemes. Let us fix $ s \in S $. Let $ \varphi : X \times _ { S }   \mathcal{O}_{S,s}   \to   Y   \times _ { S }   \mathcal{O}_{S,s} $ be a morphism of $ S $-schemes.   Show that there exists  an  open subset $ W \ni s $ of $ S $ and a morphism $ f : X \times _ { S }  W  \to   Y  \times _ { S } W $  such that $ \varphi $ is obtained   from $ f $ via   base  change  $ \text{Spec} \mathcal{O}_{S,s}   \to   W   $. If $ \varphi $ is an isomorphism, show that   there exists such an  $ f  $ which is moreover an isomorphism. 
$ \quad  $ 
P.S. This question is Exercise 2.3.5 from Qing Liu's book and is related to "Extending a morphism of schemes", "Extending a morphism from Spec $\mathcal{O}_{X,x}$".    I am writing the solution below in order to record some of the details that initially trumped me. 

Slightly less pedantic version of the same solution for quicker future reference.   
We can assume that $ X $ and $ S $ are affine, say $ X =  \text{Spec } A $ and $ S = \text{Spec } R $, since $ X $ is quasi-compact and we can shrink $ S $ to an open subset any finite number of times. Denote $ s $ by the prime $ \mathfrak{p} \subset R $.  Let  $ L    = R  \setminus   \mathfrak{p} $. If $ Y $ is affine as well, say $ Y = \text{Spec } B $, the problem just boils down to showing that a map $  L ^ { - 1  }  B  =  B \otimes  R_ { \mathfrak{p}  }  \to     A  \otimes R _ { \mathfrak { p } }       =      L ^ { -  1 }  A  $ actually comes from (i.e. is the localization of) a map $ B_{r} \to A_{r} $ for some $ r \in  L    $ which is not hard using finiteness conditions on $ B $.  
In general, we can choose a finite  open affine cover $ V_{i} = \text{Spec } B_{i} $ of $ Y $ for $ i = 1, \ldots, n $.  The   inverse images $ U_{i} ' = \varphi^{-1} ( \text{Spec } ( L  ^ { -1  } B_{i} ) )  $ can be covered with   a  finite  number of open affines of $    \text {Spec  }   L   ^ {- 1 }  A $, which in turn, can be covered with principal  open   affines.      So, altogether we can choose a collection of $ g_{j} \in  L   ^ { -   1  }  A    $ for $ j = 1 , \ldots, m $ such  that $ \text{Spec }  
 (   L ^ { - 1 }  A    ) _ { g_{j } }   $  cover  $  \text{ Spec }  L  ^{-1} A $ and each such open set lands in some $   \text{Spec } {   L   ^  { - 1  }  B_{i} }  $ under $ \varphi  $.   Suppose $ g_{j} =   \frac{x_{j} } { y_{j} } $ for $ x_{j} \in A $, $ y_{j} \in  L $. As $ y_{j} $ is invertible in $  L ^{-1} A $, we can assume $ y_{j} = 1 $.   From  the commutative algebra trick above, the maps $$ \text{Spec }  L ^{-1} ( A _ { x_{j} } ) \to    \text{Spec }  L ^ { -  1  }  B_{i}  $$
actually come from some maps 
$$    (  B_{i}  ) _ { r_{ij} }  \to  (  A_{x_{j} }  ) _ {r_{ij} }    \quad     r_{ij}  \in  T     $$
by localizing at $ T $. By taking the product $ r $ of all the $ r_{ij} $, we see that we have maps $$  
 \left  ( \bigcup _ { j }  \text{ Spec } A_{x_{j} }  \right )  \times_{S}  \text{ Spec } R_ { r }  \to    \left (  \bigcup _ { i }   \text {Spec } B  _ { i }   \right  )   \times _ {S}  \text{ Spec } R_{r}   $$
Now, the union of $ \text{ Spec } B_{j} $ is $ Y $ by definition, but $ \bigcup _ { i }  \text{Spec }  A _ { x_{i} } $ is not necessarily a cover of $ X = \text{Spec } A $.   However, we can fix   this as follows. 
Inside $ A $, we have $$ D( x_{1} )  \cup D(x_{2} )  \cup \ldots  \cup D(x_{n} )  = D( x_{1}, x_{2}, \ldots, x_{n} ) = D( \alpha ) $$
for some $ \alpha \in R $, since $ x_{i}/1 $  generate   the unit ideal in $  L 
 ^ { - 1  } A $. By further   localizing $ R $ at $ \alpha $,  we  can  make   sure that $ D(x_{i} )  $  forms a cover of $ \text{Spec }  A $.           
