Let $X$ be an (affine) algebraic set i.e. the zeros' locus of a set of polynomial $S\subseteq k[X_1,\ldots,X_n],$
Let's look at these two definitions:
1) A regular function in $p\in X$, is an element of the following ring: $\mathcal O_{X,\,p}=\{\frac{f}{g}\;:\;f,g\in k[X_1,\ldots,X_n]/I(X),\;g(p)\neq 0\}$ Moreover a regular function on $U\subseteq X $ open (respect the Zariski toplogy?) is an element of the ring $\mathcal O_X(U)=\bigcap_{p\in U} \mathcal O_{X,\,p}$
2) If $U\subseteq X$ is open (respect the Zariski toplogy?), a set theoretic function $\phi:U\rightarrow k$ is regular at a point $p$ if exists a neighborhood $V$ of $p$ such that there are polynomials $f,g\in k[X_1,\ldots,X_n]$ with $g(q)\neq 0$ and $\phi(q)=\frac{f(p)}{g(q)}$ for all $q\in V$. It is called regular on $U$ if it is regular at every $p\in U$.
Now i have two questions:
a) Stupid question: When we talk about neighborhoods and open sets in $X$, do we refer to the Zariski topology?
b) Important question: If $X$ is irreducible, (so $k[X_1,\ldots,X_n]/I(X)$ is a domain) one can show that the two definitons are equivalent. But if $X$ is NOT irreducible we have that $2)\nRightarrow 1)$. Is it correct?