Irreducibility of $\operatorname{Spec}$ $\iff$ primality of nilradical The following is an exercise (Problem 1.19) in Atiyah and Macdonald's Introduction to Commutative Algebra text :
A topological space $X$ is said to be irreducible if $X \neq \emptyset$ and if every pair of non-empty open sets in $X$ intersect, or equivalently if every non-empty open set is dense in $X$. Show that $\operatorname{Spec}(A)$ is irreducible if and only if the nilradical of $A$ is a prime ideal.
I have a specific question about the solution to this problem found here.
Let $X_f$ be the set of prime ideals of $A$ that do not contain $f \in A$, and let $X_g$ be the set of prime ideals of $A$ that do not contain $g \in A$. Suppose $\operatorname{Spec}(A)$ is irreducible. Then the author says that $X_f \cap X_g = \emptyset \Rightarrow X_f$ is empty or $X_g$ is empty. Why does this implication hold ? Is this just a general fact about two prime ideals -- that if their intersection is empty, then one of them must be empty ?
I tried to show this implication by the contrapositive. Suppose that $X_f$ and $X_g$ are both nonempty. Then there is at least one prime ideal of $A$ that does not contain $f$, and there is at least one prime ideal of $A$ that does not contain $g$. However, I don't know how this implies that $X_f \cap X_g \neq \emptyset$ (that is, that there is at least one prime ideal that doesn't contain $f$ nor $g$).
Thanks !
 A: A topological space being irreducible means that any two nonempty open sets intersect non-trivially.
A: Let $nil(A) \subseteq A$ be the nilradical and let $\pi: A \rightarrow A/nil(A)$ be the canonical map. The map $\pi$ induce a homeomorphism of topological spaces
$$H1.\text{   } Spec(A) \cong Spec(A/nil(A)).$$
Hence $T:=Spec(A)$ is irreduible iff $S:=Spec(B):=Spec(A/nil(A))$ is irreducible.
Assume $B$ is a domain and assume $D(f) \cap D(g)=D(fg)=\emptyset$. It follows $fg$ is nilpotent, and since $B$ is reduced it follows $fg=0$. Since $B$ is a domain it follows $f$ or $g=0$. Hence $D(f)=\emptyset$ or $D(g)=\emptyset$. Hence $S$ is irreducible.
Conversely if $B$ is reduced and $S:=Spec(B)$ is irreducible. Let $f,g \neq 0 \in B$ be elements with $fg=0$. It follows $V(fg)=S$ hence $D(fg)=D(f) \cap D(g)=\emptyset$. Since $S$ is irreducible we must have $D(f)=\emptyset$ hence $f$ is nilpotent. It follows $f\in nil(B)=(0)$ hence $B$ is a domain.
Note: I use the notion "irreducibility" from Hartshorne, Proposition II.3.1 and AM. Ex.1.19:
Definition: A topological $X$ space is "irreducible" iff every pair of nonempty open sets in $X$ intersect.
When is the diagonal a closed immersion with open image?
