An open subset of an irreducible set is dense. I'm trying to understand this example in Hartshorne's algebraic geometry book

In order to prove the irreducible part, suppose $Y$ is an irreducible space and $Y'$ a open subset of $Y$ with $Y'=Y'_1\cup Y'_2$ with $Y'_1,Y'_2$ proper closed subsets. Then $Y=(Y-Y')\cup (Y'_1\cup Y'_2)$ contradiction because $Y$ is irreducible.
Am I right? I need help also in the density part, I'm really stuck I don't know even how to begin.
Thanks a lot.
 A: For a slightly different proof not using the density, consider that if an open subset $U \subset Y$ is reducible we can write $U = (U \setminus V) \cup (U \setminus W)$ for $V, W$ open non-empty subsets of $U$. Since $U$ is itself open, $V$ and $W$ will also be open subsets of $Y$. Hence we can write $Y = (Y \setminus V) \cup (Y \setminus W)$, so $Y$ is reducible.
A: Your proof for the irreducible part is wrong. For example what do you mean by $Y' = Y_1 \cup Y_2$ with $Y_1,Y_2$ closed? The key question is closed in which space? First I would prove that an open subset of an irreducible space is dense: If $U$ open and non-empty is such that $\overline{U} \neq Y$ then immediately we can write $Y= U^c \cup \overline{U}$ contradicting $Y$ being irreducible.
Then now you can use this result to prove that any open subset of an irreducible space is irreducible: If $U = A \cup B$ with $A,B$ closed in $U$ then taking closures in $Y$ we get that $Y = \overline{U} = \overline{A} \cup \overline{B}$ and so this forces $\overline{A} = Y$ say. But now the closure of $A$ in $U$ which is equal to $\overline{A} \cap U$ is also equal to $A$ because $A$ was closed in $U$ by assumption. Thus $A = \overline{A} \cap U = Y \cap U = U$. It follows $U$ is irreducible in the subspace topology on it.
