I am currently working through the section on morphisms in Hartshorne's Algebraic Geometry. He introduces the notion of a function regular at a point $P$ as follows:
A function $f:Y \to k$ (where $Y$ is a quasi-affine variety in $\mathbf{A}^n$, the $n$-dimensional affine space and $k$ an algebraically closed field) is regular at a point $P \in Y$ if there is an open neighborhood $U$ with $P \in U \subseteq Y$ and polynomials $g,h \in k[x_1, \ldots, x_n]$ such that $h$ is nowhere zero on $U$ and $f = g/h$ on $U$. (Here of course we interpret the polynomials as functions on $\mathbf{A}^n$, hence on $Y$).
My question is the following: is $U$ open in $Y$ (making it a quasi-affine variety itself) or is $U$ an open set of $\mathbf{A}^n$ with the Zariski topology (so the complement of some algebraic set)? I guess it must be open on $Y$, but the specific mentioning that we interprete the polynomials as functions on the whole of $\mathbb{A}^n$ makes me wonder if this is indeed the case.
"$P \in U \subseteq Y$" in your quote says that $U$ is open in $Y$, not $\Bbb A^n$. The fact that the polynomials are interpreted as polynomials on $\Bbb A^n$ is merely a reminder of what $f\in k[x_1,\cdots,x_n]$ means on $Y$, namely that we use the coordinates from $Y$'s embedding in $\Bbb A^n$ to evaluate the polynomial on $Y$.