[proofplan]
We verify the closed-set axioms directly for the collection of affine algebraic sets $V(I)$. The empty set and the whole [affine space](/page/Affine%20Space) arise as the zero loci of the unit ideal and the zero ideal. Arbitrary intersections are handled by replacing a family of ideals by their ideal sum, and finite unions are handled by replacing two ideals by their ideal product. These identities show that the declared closed sets define a topology.
[/proofplan]
[step:Realize the empty set and affine space as zero loci]
Let $R=(1)$ denote the unit ideal and let $(0)$ denote the zero ideal of $k[x_1,\dots,x_n]$. Since the constant polynomial $1\in R$ satisfies $1(a)=1$ for every $a\in \mathbb A_k^n$, no point of $\mathbb A_k^n$ lies in $V(R)$. Hence
\begin{align*}
V(R)=\varnothing.
\end{align*}
Since the zero polynomial vanishes at every point of $\mathbb A_k^n$, every point lies in $V((0))$. Hence
\begin{align*}
V((0))=\mathbb A_k^n.
\end{align*}
Thus the proposed closed sets contain both $\varnothing$ and $\mathbb A_k^n$.
[/step]
[step:Identify arbitrary intersections with zero loci of sums of ideals]
Let $\Lambda$ be an index set, and for each $\lambda\in \Lambda$ let $I_\lambda\trianglelefteq R$ be an ideal. Define the ideal
\begin{align*}
I_\Sigma=\sum_{\lambda\in\Lambda} I_\lambda
\end{align*}
to be the ideal of $R$ generated by $\bigcup_{\lambda\in\Lambda} I_\lambda$. If $\Lambda=\varnothing$, this sum is by convention the zero ideal.
We claim that
\begin{align*}
\bigcap_{\lambda\in\Lambda} V(I_\lambda)=V(I_\Sigma).
\end{align*}
Let $a\in \mathbb A_k^n$. If $a\in \bigcap_{\lambda\in\Lambda} V(I_\lambda)$, then every polynomial in every $I_\lambda$ vanishes at $a$. Every element of $I_\Sigma$ is a finite sum of elements of the form $r f$, where $r\in R$ and $f\in I_\lambda$ for some $\lambda\in\Lambda$. Since
\begin{align*}
(rf)(a)=r(a)f(a)=0,
\end{align*}
every element of $I_\Sigma$ vanishes at $a$, so $a\in V(I_\Sigma)$.
Conversely, if $a\in V(I_\Sigma)$, then every element of $I_\Sigma$ vanishes at $a$. Since $I_\lambda\subset I_\Sigma$ for every $\lambda\in\Lambda$, every element of each $I_\lambda$ vanishes at $a$. Therefore $a\in V(I_\lambda)$ for every $\lambda\in\Lambda$, so
\begin{align*}
a\in \bigcap_{\lambda\in\Lambda} V(I_\lambda).
\end{align*}
This proves the identity and hence closure under arbitrary intersections.
[guided]
The goal is to show that an arbitrary intersection of sets defined by polynomial equations is again defined by polynomial equations. Let $\Lambda$ be an index set, and for each $\lambda\in\Lambda$ let $I_\lambda\trianglelefteq R$ be an ideal. We define
\begin{align*}
I_\Sigma=\sum_{\lambda\in\Lambda} I_\lambda
\end{align*}
as the ideal generated by all polynomials appearing in any of the ideals $I_\lambda$. This means that an element of $I_\Sigma$ is a finite sum of terms $r f$, where $r\in R$ and $f\in I_\lambda$ for some $\lambda\in\Lambda$.
We prove
\begin{align*}
\bigcap_{\lambda\in\Lambda} V(I_\lambda)=V(I_\Sigma).
\end{align*}
First suppose $a\in \bigcap_{\lambda\in\Lambda} V(I_\lambda)$. Then $a$ satisfies every equation coming from every ideal $I_\lambda$: for every $\lambda\in\Lambda$ and every $f\in I_\lambda$, we have $f(a)=0$. Now take any element $h\in I_\Sigma$. By the definition of the generated ideal, $h$ is a finite sum of terms $r_j f_j$, where each $r_j\in R$ and each $f_j$ lies in some ideal $I_{\lambda_j}$. Evaluating at $a$ gives
\begin{align*}
(r_j f_j)(a)=r_j(a)f_j(a)=0.
\end{align*}
Since every term evaluates to $0$, the finite sum $h(a)$ is also $0$. Hence every $h\in I_\Sigma$ vanishes at $a$, so $a\in V(I_\Sigma)$.
Conversely suppose $a\in V(I_\Sigma)$. Then every polynomial in $I_\Sigma$ vanishes at $a$. For each fixed $\lambda\in\Lambda$, the inclusion $I_\lambda\subset I_\Sigma$ holds by construction of the ideal sum. Therefore every polynomial in $I_\lambda$ vanishes at $a$, which says exactly that $a\in V(I_\lambda)$. Since this is true for every $\lambda\in\Lambda$, we get
\begin{align*}
a\in \bigcap_{\lambda\in\Lambda} V(I_\lambda).
\end{align*}
Thus arbitrary intersections of Zariski closed sets are again Zariski closed.
[/guided]
[/step]
[step:Identify binary unions with zero loci of products of ideals]
Let $I,J\trianglelefteq R$ be ideals. Define $IJ\trianglelefteq R$ to be the ideal generated by all products $fg$ with $f\in I$ and $g\in J$. We prove
\begin{align*}
V(I)\cup V(J)=V(IJ).
\end{align*}
First let $a\in V(I)\cup V(J)$. If $a\in V(I)$, then every $f\in I$ satisfies $f(a)=0$, so every product $fg$ with $f\in I$ and $g\in J$ satisfies
\begin{align*}
(fg)(a)=f(a)g(a)=0.
\end{align*}
Since elements of $IJ$ are finite sums of such products, every element of $IJ$ vanishes at $a$. Hence $a\in V(IJ)$. The same argument applies if $a\in V(J)$.
Conversely, suppose $a\notin V(I)\cup V(J)$. Then $a\notin V(I)$ and $a\notin V(J)$. Hence there exist $f\in I$ and $g\in J$ such that
\begin{align*}
f(a)\ne 0
\end{align*}
and
\begin{align*}
g(a)\ne 0.
\end{align*}
Because $k$ is a field, the product $f(a)g(a)$ is nonzero. Since $fg\in IJ$, we have found an element of $IJ$ that does not vanish at $a$. Therefore $a\notin V(IJ)$. This proves $V(IJ)\subset V(I)\cup V(J)$, and hence
\begin{align*}
V(I)\cup V(J)=V(IJ).
\end{align*}
[/step]
[step:Extend binary unions to all finite unions and conclude the topology axiom]
The identity for binary unions gives closure under unions of two proposed closed sets. Since $\varnothing$ is already one of the proposed closed sets, the empty finite union is closed. Repeatedly applying the binary identity gives closure under every nonempty finite union.
We have shown that the collection
\begin{align*}
\mathcal C=\{V(I): I\trianglelefteq k[x_1,\dots,x_n]\}
\end{align*}
contains $\varnothing$ and $\mathbb A_k^n$, is closed under arbitrary intersections, and is closed under finite unions. Therefore $\mathcal C$ satisfies the closed-set axioms for a topology on $\mathbb A_k^n$. The topology whose closed sets are the members of $\mathcal C$ is the Zariski topology on $\mathbb A_k^n$.
[/step]