Let $R$ be a ring. Prove that a closed set $X\subseteq\operatorname{Spec}(R)$ is irreducible iff $I(X)=\bigcap_{p\in X}p$ is prime.
I proved $\rightarrow$. My attempt at $\leftarrow$ is as follows:
I assume for a contradiction that $X$ is reducible. I can then write $X=(V(I_1)\cap X)\cup(V(I_2)\cap X)$ with $V(I_1),V(I_2)\subseteq\operatorname{Spec}R$ closed sets. Since each of them is contained (and not equal) in $X$, I can find $p_i\in V(I_i)$ s.t $p_1\not\subseteq p_2$ and $p_2\not\subseteq p_1$. I know that in the finite case, that would mean that the intersection above would not be prime (it's easy to prove for two prime ideals and I guess you can inductively prove it for any finite number). But is it still true for any intersection? Otherwise, how can I get a contradiction?
Thanks in advance.
I think the main problem is that you tried phrasing the proof by contradiction. This is often unnecessary and seems to actually complicate the matter here. Let me first give a different approach.
Suppose that $\mathcal I(X)$ is prime. Then $X\ne\emptyset$ since $\mathcal I(\emptyset)=R$ is not prime. Now, consider some decomposition $X=X_1\cup X_2$ into non-empty closed sets. In order to show that $X$ is irreducible we have to show that one of $X_1,X_2$ is not proper (i.e. $X=X_1$ or $X=X_2$). Write $X_i=\mathcal V(I_i)\cap X$. Then $$ X=X_1\cup X_2=(\mathcal V(I_1)\cup\mathcal V(I_2))\cap X\quad \implies \quad X\subseteq \mathcal V(I_1)\cup\mathcal V(I_2)=\mathcal V(I_1\cap I_2) $$ by definition. Hence $$ I_1\cap I_2\subseteq\mathcal I(\mathcal V(I_1\cap I_2))\subseteq\mathcal I(X)=I\,. $$ But since $I$ is prime this implies that $I_1\subseteq I$ or $I_2\subseteq I$ concluding the proof.
Now on to your question: What theorem exactly are you referencing?