[proofplan]
We compare topological decompositions of $X$ with zero divisors in the coordinate ring. A proper closed subset of $X$ is cut out inside $X$ by at least one polynomial that does not vanish on all of $X$, and this produces nonzero coordinate-ring classes. If $X$ is reducible, two such classes multiply to zero; conversely, a zero product of two nonzero coordinate-ring classes cuts $X$ into the union of two proper closed subsets.
[/proofplan]
custom_env
admin
[step:Fix the coordinate ring notation and dispose of the empty set]
Let $R:=k[x_1,\dots,x_n]$ and, for a subset $S\subseteq \mathbb A_k^n$, let $I(S):=\{h\in R:h(a)=0 \text{ for every } a\in S\}$. Thus $k[X]=R/I(X)$.
We use the standard convention that an [integral domain](/page/Integral%20Domain) is a nonzero commutative ring with no zero divisors, and that an irreducible [topological space](/page/Topological%20Space) is nonempty. If $X=\varnothing$, then
\begin{align*}
I(X)=R.
\end{align*}
Therefore
\begin{align*}
k[X]=R/I(X)=R/R=0.
\end{align*}
Since $0$ is not an integral domain, both sides of the asserted equivalence are false. It remains to treat the case $X\ne \varnothing$.
[/step]
custom_env
admin
[step:Extract a nonzero coordinate-ring class from each proper closed subset]Let $Y\subsetneq X$ be closed in the [subspace topology](/page/Subspace%20Topology) on $X$. Since $Y$ is closed in $X$, there is a subset $\Sigma\subseteq R$ such that
\begin{align*}
Y=X\cap V(\Sigma),
\end{align*}
where
\begin{align*}
V(\Sigma):=\{a\in \mathbb A_k^n:h(a)=0 \text{ for every } h\in \Sigma\}.
\end{align*}
For a single polynomial $h\in R$, we write
\begin{align*}
V(h):=V(\{h\}).
\end{align*}
Choose $a\in X\setminus Y$. Since $a\notin X\cap V(\Sigma)$ and $a\in X$, we have $a\notin V(\Sigma)$. Therefore there exists $h\in \Sigma$ such that
\begin{align*}
h(a)\ne 0.
\end{align*}
For every $y\in Y$, the equality $Y=X\cap V(\Sigma)$ gives $y\in V(\Sigma)$, so $h(y)=0$. Thus
\begin{align*}
h\in I(Y).
\end{align*}
On the other hand, $a\in X$ and $h(a)\ne 0$, so
\begin{align*}
h\notin I(X).
\end{align*}
Consequently the residue class $\overline h\in k[X]=R/I(X)$ is nonzero.[/step]
custom_env
admin
[guided]The purpose of this step is to justify the polynomial-separation move used in the main argument. Let $Y\subsetneq X$ be a closed subset of $X$. Because $Y$ is closed in the subspace topology, it is obtained by intersecting $X$ with an affine algebraic set in the ambient [affine space](/page/Affine%20Space). Concretely, there is a subset $\Sigma\subseteq R=k[x_1,\dots,x_n]$ such that
\begin{align*}
Y=X\cap V(\Sigma).
\end{align*}
Now use the fact that $Y$ is proper. Choose a point $a\in X\setminus Y$. Since $a\in X$ but $a\notin X\cap V(\Sigma)$, the only possible failure is $a\notin V(\Sigma)$. By the definition of $V(\Sigma)$, this means that at least one polynomial $h\in \Sigma$ satisfies
\begin{align*}
h(a)\ne 0.
\end{align*}
This same polynomial vanishes on $Y$: if $y\in Y$, then $y\in V(\Sigma)$, so every polynomial in $\Sigma$ vanishes at $y$, in particular $h(y)=0$. Hence $h\in I(Y)$. But $h\notin I(X)$, because $a\in X$ and $h(a)\ne 0$. Therefore the class $\overline h$ in the [quotient ring](/page/Quotient%20Ring) $k[X]=R/I(X)$ is not the zero class. This is the exact bridge between a proper closed subset of $X$ and a nonzero function on $X$ that vanishes on that subset.[/guided]
custom_env
admin
[step:Show that a reducible affine algebraic set gives zero divisors]
Assume $X$ is reducible. Since $X\ne \varnothing$, there exist proper closed subsets $Y,Z\subsetneq X$ such that
\begin{align*}
X=Y\cup Z.
\end{align*}
By the previous step, choose polynomials $f,g\in R$ such that
\begin{align*}
f\in I(Y)\setminus I(X)
\end{align*}
and
\begin{align*}
g\in I(Z)\setminus I(X).
\end{align*}
Then $\overline f,\overline g\in k[X]$ are nonzero.
For every $x\in X$, either $x\in Y$ or $x\in Z$. If $x\in Y$, then $f(x)=0$; if $x\in Z$, then $g(x)=0$. In both cases
\begin{align*}
(fg)(x)=0.
\end{align*}
Thus $fg\in I(X)$, so
\begin{align*}
\overline f\,\overline g=\overline{fg}=0
\end{align*}
in $k[X]$. Therefore $k[X]$ has two nonzero elements whose product is zero, and hence $k[X]$ is not an integral domain.
[/step]
custom_env
admin
[step:Show that zero divisors produce a reducible decomposition]
Assume $k[X]$ is not an integral domain. Since $X\ne \varnothing$, the quotient ring $k[X]$ is nonzero, so there exist nonzero residue classes $\overline f,\overline g\in k[X]$ such that
\begin{align*}
\overline f\,\overline g=0.
\end{align*}
Choose representatives $f,g\in R$. The nonzeroness of $\overline f$ and $\overline g$ means
\begin{align*}
f\notin I(X)
\end{align*}
and
\begin{align*}
g\notin I(X).
\end{align*}
The equality $\overline f\,\overline g=0$ means $fg\in I(X)$, so for every $x\in X$,
\begin{align*}
f(x)g(x)=0.
\end{align*}
Define closed subsets of $X$ by
\begin{align*}
Y:=X\cap V(f)
\end{align*}
and
\begin{align*}
Z:=X\cap V(g).
\end{align*}
For every $x\in X$, the equality $f(x)g(x)=0$ in the field $k$ implies $f(x)=0$ or $g(x)=0$. Hence $x\in Y\cup Z$, and therefore
\begin{align*}
X=Y\cup Z.
\end{align*}
Since $f\notin I(X)$, there exists $a\in X$ such that $f(a)\ne 0$, so $a\notin Y$ and $Y\subsetneq X$. Similarly, since $g\notin I(X)$, there exists $b\in X$ such that $g(b)\ne 0$, so $b\notin Z$ and $Z\subsetneq X$. Thus $X$ is the union of two proper closed subsets, so $X$ is reducible.
[/step]
custom_env
admin
[step:Conclude the equivalence]
For $X=\varnothing$, both irreducibility and the integral-domain condition fail under the stated conventions. For $X\ne \varnothing$, the previous two steps show that $X$ is reducible if and only if $k[X]$ has nonzero zero divisors. Equivalently, $X$ is irreducible if and only if $k[X]$ is an integral domain.
[/step]