Locally closed irreducible subset of an affine scheme. I'm self-studying some Algebraic Geometry and I have the following question.
Let us take $X=\operatorname{Spec}A$, where $A$ is a commutative ring. I am trying to show that every locally closed irreducible subset of $X$ contains an unique generic point.
This is what I've been thinking so far:
Let $Y$ be our irreducible, locally closed subset. We know that $q=I(Y) = \bigcap_{p \in Y} p$ is a prime ideal, I believe we would be done if we could show that $q \in Y$. Let us write $Y = V(\mathfrak{a}) \cap U$, for $U$ open. If $U$ would happen to be a principal open, of the form $D(f)$, then $Y = V(\mathfrak{a}) \cap U$ could be written as $\operatorname{Spec}B$ where $B = A_f / \mathfrak{a}A_f$. In this case, to say that Spec B is irreducible would simply mean that it had an unique minimal prime, which of course would have to lie in $\operatorname{Spec}B$. I feel uneasy about this argument, and I'm not totally sure if it is correct. However, if it is done in this special case, how could it be used to show the general case?
I guess we could argue from our special case if we wrote $Y = V(\mathfrak{a}) \cap  (\bigcup_i D(f_i)) = \bigcup_i (V(\mathfrak{a}) \cap D(f_i))$,  but I'm not sure.
So, I am very grateful for any help here, and answers on how to tackle this.
 A: Write $Y=\bar Y\cap U$ where "bar" means closure in the topological space $X$ and $U\subset X$ is some open set.
Existence of generic point
 Since $Y$ is irreducible, so is $\bar Y$.
 Therefore $\bar Y$ has a generic point $\eta$ and $\bar{ \lbrace \eta\rbrace }=\bar Y$.
Of course $\eta\in Y$, else we would have $\bar{ \lbrace \eta\rbrace }=\bar Y\subset X\setminus U$ and thus $\overline { Y}\cap Y=\emptyset$, an absurd statement.
Thus $\eta$ is a generic point for  $Y$ since its closure in $Y$ is $\bar Y\cap Y=Y$.  
Uniqueness  of generic point
If $\eta'$ were another generic point of $Y$, its closure in $X$ would also be $\bar Y$.
But an irreducible closed subset of a scheme has only one generic point, hence $ \eta'=\eta$ .
Edit: Warning !
If $Y \subset X=Spec(\mathbb Z)$ is the complement of the generic point $\eta=(0)\in Spec(\mathbb Z)$, then $Y$ is an  irreducible subspace of $X$.  However $Y$ has no generic point!
The explanation of this apparent contradiction to the above  is that $Y$ is not locally closed in $X$.
A: We use the order reversing bijective correspondence between closed subsets and radical ideals multiple times. 
Let $V(I)$ be an irreducible closed subset, where $I$ is a radical ideal. Let $J,K$ be any ideals, if $JK\subset I$, then $V(I)\subset V(JK)=  V(J)\cup V(K)$. Therefore we have the decomposition of
$$V(I) = \left(V(I)\cap V(J)\right) \bigcup \left(V(I)\cap V(K)\right).$$ 
By irreducibility, we must have WLOG $V(I) = V(I)\cap V(J)$, that is $V(I)\subset V(J)$. From here we pass to the radical and conclude that $J\subset \sqrt{J}\subset \sqrt{I} = I$.
Using similar argument we can see easily that if $I$ is prime, then $V(I)$ is an irreducible closed subset. Therefore we have a bijection between irreducible closed subsets and prime ideals, which are points of the affine scheme.
