I am following Shaferevich's Basic Algebraic Geometry 1.Here quasiprojective variety means open subset of a projective closed set. He defines regular maps between quasiprojecive varities (in section 4.2) as locally $f:U\rightarrow \mathbb A_i^m$ is regular. My question is how to define regular map $f:X\rightarrow Y$, where $X$ may be open subset of $\mathbb A^n$ or closed subset of $\mathbb A^n$ or quasiprojective and $Y$ may be open subset of $\mathbb A^n$ or closed subset of $\mathbb A^n$ or quasiprojective. If both $X$ and $Y$ are closed subset of some affine space then I know $f$ is given by polynomials. But what about the other cases.
I know closed subset or open subset of of $\mathbb A^n$ can be regarded as quasiprojective in $\mathbb P^n$ (after identifying $\mathbb A^n$ with one of $\mathbb A_i^n$ in $\mathbb P^n$ and by identifying I mean set theoretically, at least Shaferevich says so[Discussion after Lemma $1.1$ in section $4.1$] ). So to check the map is regular do I need to identify both $X$ and $Y$ to the subsets of $\mathbb P^n$ and $\mathbb P^m$ respectively and then check the corresponding map is regular?
Let me discuss one example:
I need to show $\mathbb A^1-\{0\}$ is isomorphic to $Z(T_1T_2-1)$ in $\mathbb A^2$. Lets identify $\mathbb A^1-\{0\}$ with $X=\{(1:x) :x\in k^* \}\subset\mathbb P^1$ and $Z(T_1T_2-1)$ with $Y=\{(1:x:y):x,y\in k,xy=1\}$ so that both $X$ and $Y$ are quasiprojective varieties. Then define $\begin{equation} f:X\rightarrow Y\\ (1:x)\mapsto (1:x:\frac{1}{x}) \end{equation}$
$\begin{equation} g:Y\rightarrow X\\ (1:x:y)\mapsto (1:x) \end{equation}$
If coordinates of $\mathbb P^1$ are $S_0, S_1$ and that of $\mathbb P^2$ are $T_0, T_1, T_2$ then $f$ is given by $1, \frac{S_1}{S_0}, \frac{S_0}{S_1}$ and $g$ is given by $1, \frac{T_1}{T_0}$. Hence $f$ and $g$ are regular and also they are inverse of each other.
Is this method correct or I am making some mistake or doing this in a complicated way?
Please help me to understand. Thank you