Restriction of morphism of algebraic sets is again a morphism

Consider the polynomial ring $k[x_1, \ldots, x_n]$ with coefficients in an algebraically closed field $k$, and let $V \subseteq k^n$ be an algebraic set. It is well-known that a principal open set $V_f \subseteq k^n$, for some non-zero polynomial $f$, may be regarded as an algebraic set $\tilde{V}_f$ in $k^{n+1}$.

Now, let $\varphi \colon V \to W$, $V \subseteq k^n$, $W \subseteq k^m$, be a morphism of algebraic sets represented by $(\varphi_1, \ldots, \varphi_m)$, and let $f \in k[x_1, \ldots, x_n]$ and $g \in k[x_1, \ldots, x_m]$ be non-zero polynomials. I want to prove that, under the assumption that the restriction of $\varphi$ to $V_f$ gives a well-defined map of sets $$\Psi:=\varphi_{\vert V_f} \colon \tilde{V}_f \stackrel{bij.}{=}V_f \to W_g \stackrel{bij.}{=}\tilde{W}_g,$$ $\Psi$ is a morphism of algebraic sets.

$\textbf{My approach}$: $\Psi$ takes $(a,1/f(a)) \in \tilde{V}_f \subseteq V \times k$ to $(\varphi(a), 1/g(\varphi(a)))$. Thus, I have to prove that there exists some $\varphi_{m+1} \in k[x_1, \ldots, x_{n+1}]$ such that $\varphi_{m+1}(a,1/f(a))=1/g(\varphi_1(a), \ldots, \varphi_m(a))$ for all $a$ in $V_f$. I don't see a way of explicitly constructing $\varphi_{m+1}$ since I don't know what the relations (given by the vanishing ideal of $V$) of the coordinates of $a$ look like.
Instead, my idea is to construct a $k$-algebra homomorphism of the corresponding coordinate rings and then using the 1-1-correspondence between morphisms $\tilde{V}_f \to \tilde{W}_g$ and $k$-algebra homomorphisms $S^{-1}_g(k[W]) \cong k[\tilde{W}_g] \to k[\tilde{V}_f] \cong S^{-1}_f(k[V])$.
However, I do not see how to define the right $k$-algebra homomorphism. Maybe this isn't the right way to go. Any help in form of hints is appreciated.

1 Answer

Hint: Let $I\subseteq k[x_1,\dots,x_{n+1}]$ be the ideal of polynomials vanishing on $\tilde{V}_f$, and consider $h=g\circ \varphi$ as a polynomial in $x_1,\dots,x_n$. The statement that the image of $\varphi|_{V_f}$ is contained in $W_g$ says that there is no point of $k^{n+1}$ where every element of $I$ vanishes and also $h$ vanishes. Now use the Nullstellensatz.