[proofplan]
The proof is the standard contravariant construction. A morphism gives a pullback map by composing regular functions, and this immediately respects the $k$-algebra operations. Conversely, a $k$-algebra homomorphism is determined by the images of the coordinate classes on $Y$; choosing polynomial representatives for those images defines coordinate functions on $X$. The defining equations of $Y$ are respected because relations in $I(Y)$ map to zero in $k[X]$, so the resulting polynomial map lands in $Y$, and uniqueness follows from the coordinate functions.
[/proofplan]
[step:Pull back regular functions along a morphism]
Let
\begin{align*}
\phi: X \to Y
\end{align*}
be a morphism of affine varieties. By the definition of morphism between affine varieties, if $g \in k[Y]$ is a regular function on $Y$, then the composite function
\begin{align*}
g \circ \phi: X \to k
\end{align*}
is a regular function on $X$, hence represents an element of $k[X]$. Therefore the assignment
\begin{align*}
\phi^*: k[Y] \to k[X], \quad g \mapsto g \circ \phi
\end{align*}
is well-defined.
For $g_1,g_2 \in k[Y]$ and $a \in k$, the pointwise identities on $X$ give
\begin{align*}
\phi^*(g_1+g_2)=(g_1+g_2)\circ\phi=(g_1\circ\phi)+(g_2\circ\phi)=\phi^*(g_1)+\phi^*(g_2).
\end{align*}
Similarly,
\begin{align*}
\phi^*(g_1g_2)=(g_1g_2)\circ\phi=(g_1\circ\phi)(g_2\circ\phi)=\phi^*(g_1)\phi^*(g_2).
\end{align*}
Also,
\begin{align*}
\phi^*(a)=a
\end{align*}
because the constant function with value $a$ pulls back to the constant function with value $a$, and
\begin{align*}
\phi^*(1)=1.
\end{align*}
Thus $\phi^*$ is a unital $k$-algebra homomorphism.
[/step]
[step:Recover coordinate functions from a $k$-algebra homomorphism]
Let
\begin{align*}
\alpha: k[Y] \to k[X]
\end{align*}
be a unital $k$-algebra homomorphism. For each $j \in \{1,\ldots,m\}$, let $\overline{y}_j \in k[Y]$ denote the residue class of the coordinate polynomial $y_j \in k[y_1,\ldots,y_m]$. Define
\begin{align*}
f_j := \alpha(\overline{y}_j) \in k[X].
\end{align*}
Since $k[X]=k[x_1,\ldots,x_n]/I(X)$, choose a polynomial representative
\begin{align*}
F_j \in k[x_1,\ldots,x_n]
\end{align*}
whose residue class in $k[X]$ is $f_j$.
Define a map
\begin{align*}
\phi: X \to \mathbb{A}^m_k, \quad x \mapsto (F_1(x),\ldots,F_m(x)).
\end{align*}
This map is independent of the values of the representatives on $X$: if $F_j'$ is another representative of $f_j$, then $F_j-F_j' \in I(X)$, so $F_j(x)=F_j'(x)$ for every $x \in X$.
[/step]
[step:Show the recovered map lands in $Y$]
We prove that $\phi(X) \subset Y$. Let
\begin{align*}
h \in I(Y)
\end{align*}
be a polynomial relation vanishing on $Y$. Its residue class in $k[Y]$ is zero, so
\begin{align*}
\alpha(\overline{h})=0 \in k[X],
\end{align*}
where $\overline{h}$ denotes the residue class of $h$ in $k[Y]$.
Since $\alpha$ is a $k$-algebra homomorphism and $h$ is a polynomial in the coordinate classes $\overline{y}_1,\ldots,\overline{y}_m$, we have
\begin{align*}
\alpha(\overline{h})=h(\alpha(\overline{y}_1),\ldots,\alpha(\overline{y}_m))=h(f_1,\ldots,f_m).
\end{align*}
Thus $h(f_1,\ldots,f_m)=0$ in $k[X]$. In terms of the chosen representatives, this means
\begin{align*}
h(F_1,\ldots,F_m)(x)=0
\end{align*}
for every $x \in X$.
Therefore, for each $x \in X$, every polynomial in $I(Y)$ vanishes at $\phi(x)$. Hence
\begin{align*}
\phi(x) \in V(I(Y)).
\end{align*}
Because $Y$ is an [affine variety](/page/Affine%20Variety) over the [algebraically closed field](/page/Algebraically%20Closed%20Field) $k$, the affine Nullstellensatz gives $V(I(Y))=Y$. Thus $\phi(x)\in Y$ for every $x\in X$, so $\phi$ is a map
\begin{align*}
\phi: X \to Y.
\end{align*}
[guided]
We must check that the polynomial formula just constructed actually has values in $Y$, not merely in the ambient [affine space](/page/Affine%20Space) $\mathbb{A}^m_k$. The set $Y$ is cut out by its vanishing ideal $I(Y)$: a point belongs to $Y$ precisely when all polynomials in $I(Y)$ vanish at that point, using the affine Nullstellensatz over the algebraically closed field $k$.
Take an arbitrary relation
\begin{align*}
h \in I(Y).
\end{align*}
The residue class $\overline{h}$ of $h$ in the coordinate ring $k[Y]=k[y_1,\ldots,y_m]/I(Y)$ is zero. Applying the homomorphism $\alpha$ gives
\begin{align*}
\alpha(\overline{h})=0 \in k[X].
\end{align*}
Now use the fact that $\alpha$ is a $k$-algebra homomorphism. Since $h$ is obtained from the coordinate polynomials $y_1,\ldots,y_m$ by addition, multiplication, and scalar multiplication over $k$, applying $\alpha$ to the class of $h$ is the same as evaluating the same polynomial expression at the images of the coordinate classes:
\begin{align*}
\alpha(\overline{h})=h(\alpha(\overline{y}_1),\ldots,\alpha(\overline{y}_m)).
\end{align*}
By definition, $\alpha(\overline{y}_j)=f_j$, so
\begin{align*}
h(f_1,\ldots,f_m)=0 \in k[X].
\end{align*}
Each $f_j$ is represented by the polynomial $F_j \in k[x_1,\ldots,x_n]$. Therefore the equality $h(f_1,\ldots,f_m)=0$ in $k[X]$ says exactly that the polynomial $h(F_1,\ldots,F_m)$ lies in $I(X)$, meaning
\begin{align*}
h(F_1,\ldots,F_m)(x)=0
\end{align*}
for every $x \in X$. But $\phi(x)=(F_1(x),\ldots,F_m(x))$, so this is the same as
\begin{align*}
h(\phi(x))=0
\end{align*}
for every $x \in X$.
Since this holds for every $h \in I(Y)$, every defining relation of $Y$ vanishes at $\phi(x)$. Hence $\phi(x)\in V(I(Y))$. Finally, because $k$ is algebraically closed and $Y$ is an affine variety, the affine Nullstellensatz identifies $V(I(Y))$ with $Y$. Thus $\phi(x)\in Y$ for every $x\in X$, and the constructed map is genuinely a map $\phi:X\to Y$.
[/guided]
[/step]
[step:Verify that the recovered map is a morphism]
The map
\begin{align*}
\phi: X \to Y, \quad x \mapsto (F_1(x),\ldots,F_m(x))
\end{align*}
has coordinate functions obtained by restricting polynomials $F_1,\ldots,F_m \in k[x_1,\ldots,x_n]$ to $X$. By the definition of a morphism of affine varieties, this makes $\phi$ a morphism.
[/step]
[step:Compute the induced pullback on coordinate generators]
We show that $\phi^*=\alpha$. For each $j \in \{1,\ldots,m\}$ and each $x \in X$,
\begin{align*}
\phi^*(\overline{y}_j)(x)=\overline{y}_j(\phi(x))=F_j(x).
\end{align*}
The residue class of $F_j$ in $k[X]$ is $f_j=\alpha(\overline{y}_j)$, so
\begin{align*}
\phi^*(\overline{y}_j)=\alpha(\overline{y}_j)
\end{align*}
for every $j \in \{1,\ldots,m\}$.
The coordinate ring $k[Y]$ is generated as a $k$-algebra by $\overline{y}_1,\ldots,\overline{y}_m$. Since $\phi^*$ and $\alpha$ are both unital $k$-algebra homomorphisms and agree on these generators, they agree on all of $k[Y]$. Hence
\begin{align*}
\phi^*=\alpha.
\end{align*}
[/step]
[step:Prove uniqueness from the coordinate pullbacks]
Let
\begin{align*}
\psi: X \to Y
\end{align*}
be a morphism such that $\psi^*=\alpha$. For each $j \in \{1,\ldots,m\}$, equality of pullbacks gives
\begin{align*}
\psi^*(\overline{y}_j)=\alpha(\overline{y}_j)=f_j.
\end{align*}
Thus, for every $x \in X$,
\begin{align*}
\overline{y}_j(\psi(x))=F_j(x).
\end{align*}
Therefore the $j$-th coordinate of $\psi(x)$ equals the $j$-th coordinate of $\phi(x)$ for every $j \in \{1,\ldots,m\}$. Hence
\begin{align*}
\psi(x)=\phi(x)
\end{align*}
for every $x \in X$, so $\psi=\phi$.
We have shown that every morphism induces a unital $k$-algebra homomorphism by pullback, and every unital $k$-algebra homomorphism arises from a unique morphism. This proves the theorem.
[/step]