In The book Basic Algebraic Geometry 1 by Shaferevich page 37 (1st paragraph) it says that if $\phi$ is a rational function (elements of quotient field of the ring of regular functions on $X$, $k[X]$) on an affine variety $X$ (irreducible closed subset of some $\mathbb{A}^n$) and $\phi =0$ on some non-empty open subset $U$ of $X$ the $\phi=0$ on $X$. My questions are:
(i) When it says that $\phi =0$ on $X$ does it mean that $\phi$ is zero whenever it is well-defined (because a rational function may not be well-defined on each point of X) or $\phi$ will be defined at every point of $X$ and $\phi=0$ on $X$.
(ii) To prove the statement it says that if $\phi\neq 0$ on $X$ any expressiom $\phi=\frac{f}{g}$ with $f,g\in k[X]$ gives a representation of $X$ as a union $X=X_1\cup X_2$ where $X_1=X-U$ and $X_2=Z(f)$ which will be a contardiction to the irreducibility of $X$. I could not understand the decomposition. The decomposition basically says that $Z(f)\supset U$ but I don't see how. Because it may happent that at some point of $U$, $g$ is zero.
Here $Z(f)=\{x\in X: f(x)=0\}$
Thank you very much.