Volume I of Shaferevich's Basic Algebraic Geometry has the following as an exercise:
Show that the affine variety $U$ is irreducible if and only if its closure $\bar U$ in a projective space is irreducible.
Unfortunately, he doesn't explicitly give a definition of irreducibility for quasiprojective varieties. Based on the definition for (closed) sets in affine space, I assumed that a quasiprojective variety $X$ is reducible if there are closed sets $Z_1, Z_2$ such that neither contains $X$ and such that $$\left ( Z_1 \cap X \right ) \cup \left ( Z_2 \cap X \right ) = X$$ (i.e. $X$ can be written as a nontrivial union of sets that are closed with respect to $X$).
I found a pretty easy proof that $U$ is reducible iff $\bar U$ is, which gives the proposition. However, I'm suspicious because it doesn't rely at all on the fact that $U$ is an affine variety, or even a quasiprojective variety at all (in the sense that if you defined irreducibility for arbitrary subsets of projective space, it would still work).
One reason for this could be that a quasiprojective variety is irreducible iff its projective closure is, and the point of the exercise is to notice this, and that the definitions of irreducibility for affine varieties and for affine closed sets agree. The other could be that my solution doesn't work, or that I have the wrong definition. I'm asking which is the case.
My proof is as follows: First assume that $U$ is reducible. The we have closed sets $Z_1$, $Z_2$, neither of which contain $U$, such that $ \left ( Z_1 \cap U \right ) \cup \left (Z_2 \cap U \right ) = U$. As $Z_1 \cup Z_2 \supseteq U$ is closed, we have $Z_1 \cup Z_2 \supseteq \bar U$. But then neither of the $Z_i$ contain $\bar U$, since $\bar U \supseteq U$, and since $Z_1 \cup Z_2$ is a closed set containing $U$, $Z_1 \cup Z_2$ contains $\bar U$ and $\left ( Z_1 \cap \bar U \right ) \cup \left ( Z_2 \cap \bar U \right ) = \bar U$ so that $\bar U $ is reducible. The proof for the other direction is almost identical.