I have a problem with a detail of Qing Liu's proof of Proposition 4.3.8 (pag. 137 of "Algebraic Geometry and Arithmetic Curves"). The statement is:
Let $Y$ be a scheme having only a finite number of irreducible components. Let $f:X\rightarrow Y$ be a flat morphism. Let us suppose that $Y$ is reduced (resp. irreducible; resp. integral) and that the generic fibers of $Y$ are also reduced (resp. irreducible; resp. integral); then $X$ is reduced (resp. irreducible; resp. integral).
The proof starts with irreducibility:
Let us suppose $Y$ is irreducible with generic point $\eta$, and $X_{\eta}$ irreducible. Then $Z:=\overline{X_{\eta}}$ is a closed irreducible subset of $X$. Its complement $U=X\setminus Z$ is an open subset of $X$ which does not dominate $Y$.
My problem is that I cannot find a good reason for this last adfirmation. I could fix it just in the case of $X$ with a finite number of irreducible components, but how can I prove it for the general case? Thank you :)