In Hartshorne, Corollary 1.4, Algrebraic set irreducible iff its ideal is a prime ideal, the demonstration of the $\Leftarrow$ conditional goes like this:
Conversely, let $\mathfrak{p}$ be a prime ideal, and suppose that $Z(\mathfrak{p}) = Y_1 \cup Y_2$. Then $\mathfrak{p} = I(Y_1) \cap I(Y_2)$, so either $\mathfrak{p} = I(Y_1)$ or $\mathfrak{p} = I(Y_2)$, hence it is irreducible.
I fail to see how exactly to use the prime property of the ideal to prove that either $\mathfrak{p} = I(Y_1)$ or $\mathfrak{p} = I(Y_2)$.
Could anyone help with this one ?
If neither Ideal is contained in the other, you can take two elements, each contained in one of the ideals and not in the other. The product of those two elements will be in the intersection, showing that the intersection cannot be prime.