The Problem
Let $\varphi:X\to Y$ be a morphism of quasi-affine varieties. Let $Z\subset X$ be a locally closed sub-variety (that is, $Z$ is an open sub variety of a closed subvariety). Show that $\varphi|_Z:Z\to Y$ is also a morphism.
Necessary Definitions
A quasi-affine variety is a topological space $X$ together with an algebra of $\mathbb{C}$-valued functions $\mathcal{O}(X)$ such that:
There is a homeomorphism $\psi:X\to U_X$ where $U_X$ is an open subset of an algebraic set in $\mathbb{C}^n$ for some $n$.
The induced algebra homomorphism $\psi^*:\mathcal{O}(U_X)\to \mathcal{O}(X)$ is an isomorphism of $\mathbb{C}$-algebras.
A morphism of quasi-affine varieties is a map $\Psi:X\to Y$ between quasi-affine varieties such that for every $f\in \mathcal{O}(Y)$, $f\circ \Psi\in \mathcal{O}(X)$.
Discussion
My first observation is that we should be able to reduce the problem to the case where $X$ and $Y$ are open subsets of algebraic sets, i.e. we can replace them by $U_X$ and $U_Y$ and suppose that $\varphi:U_X\to U_Y.$ (Although I don't know if this should be necessary)
My biggest problem with this question is that I don't know what exactly the ring of functions $\mathcal{O}(Z)$ should be for a locally closed subset $Z$ of $U_X$.
Abusing notation I will write $X$ for the algebraic set $U_X$ belongs to and $Y$ for the one $U_Y$ belongs to. I do know how to describe $\mathcal{O}(U_X)$ (or more generally the $\mathcal{O}(U)$ for an open subset $U$ of an algebraic set):
$f:U_X\to \mathbb{C}$ belongs to $\mathcal{O}(U_X)$ if there exists an open cover $\{U_i\}$ of $U_X$ such that on $U_i$, $f=g_i/h_i$ with $g_i,h_i\in \mathcal{O}(X)$ and $h_i(x)\neq 0$ for all $x\in U_i$.
Since $\varphi:U_X\to U_Y$ is a morphism, for all $f\in \mathcal{O}(U_Y)$, $f\circ \varphi\in \mathcal{O}(U_X)$, that is, there exists an open cover $\{U_i\}$ of $U_X$ such that on $U_i$, $f\circ \varphi=g_i/h_i$ with $g_i,h_i\in \mathcal{O}(X)$ and $h_i(x)\neq 0$ for all $x\in U_i$ (*).
Let $Z=U\cap X'$ where $U$ is an open sub-variety of $U_X$ and $X'$ is a closed sub-variety. By $(*)$ we have that for all $f\in \mathcal{O}(U_Y)$, there is a cover $Z=\cup_i V_i$ (With $V_i=U_i\cap U\cap X'$) such that on $V_i$, $f\circ \varphi|_Z=g_i/h_i$ with $g_i,h_i\in \mathcal{O}(X)$ and $h_i(x)\neq 0$ for all $x\in V_i$
Is this equvialent to saying $f\circ \varphi|_Z$ belongs to $\mathcal{O}(Z)$? This depends on how $\mathcal{O}(Z)$ is characterized, and this I am unsure of.
Maybe someone has some insight into this?