Irreducibility of an affine variety in an affince space vs in a projective space. Proposition 5.5 in Undergraduate Algebraic Geometry by Reid says (I only write down a brief idea since the proposition is long and involves some other notations to define):

The affine variety $U$ is irreducible if and only if its closure $\bar{U}$ in a projective space is irreducible.

I can prove it using the correspondence between $U$ and $I(U)$, and between $\bar{U}$ and $I^h(\bar{U})$ where $I^h$ is the homogeneous ideal defined by the projective variety $\bar{U}$. I believe it was correct. 
I read this question: Irreducibility of an Affine Variety and its Projective Closure
and found a much shorter proof provided by the OP. But I am confused about it.
He assumed $U=Z_1\cup Z_2$ where $Z_1, Z_2$ are closed sets. So $Z_1\cup Z_2 \supset \bar{U}$.
Maybe because I have little background in topology, I am very confused here. The irreducibility of an affine variety $U$ is defined by its not being a union of two nonempty varieties. If $Z_1,Z_2$ are defined this way, then in the sense of Zariski topology in projective space, $Z_1, Z_2$ are open sets.
From another direction, if we define irreducibility of an affine variety in terms of union of closed sets, is it in the sense of the Zariski topology in the affine space or projective space? If it is in affine space, then $Z_1, Z_2$ are not closed in the projective space. 
Isn't there an ambiguity in this definition and the above proof?
Thank you for your help.
 A: What definition of irreducible are you using? The one I have in mind, which is also the definition given in Hartshorne, is:

Definition: A nonempty subset of a topological space $Y \subseteq X$ is irreducible if it cannot be expressed as a union $Y = Y_1 \cup Y_2$ of two proper subsets each of which is closed in $Y$. 

Thus, we say that a reducible space is a not irreducible space, hence why we assume $Y = Y_1 \cup Y_2$, where $Y_i$ are proper spaces closed in the subspace topology of $Y$. 

The irreducibility of an affine variety is defined by its not being a union of two nonempty varieties.

I'm a bit confused by this. Irreducibility is a notion that comes from general topology. Therefore, when constructing algebraic geometry, we should be careful and ensure that our terminologies coincide with notions from topology. The above statement could be fine as a theorem, but not as a definition. 
Also, it should be noted that authors frequently distinguish between algebraic sets and algebraic varieties. For me, algebraic variety means an irreducible algebraic set. 
