How do morphisms between affine varieties induce ring homomorphisms? .An algebraic set defined by $S \subseteq k[x_1,...,x_n]$ is given by
$$X = \{a \in \mathbb{A}^n(k) | f(a) = 0, \forall f\in S\}$$
Suppose $X \subseteq \mathbb{A^n}(k)$ and $Y \subseteq \mathbb{A^m}(k)$ are algebraic sets. The morphisms between $X$ and $Y$ are the polynomial mappings:
$$\phi: X \rightarrow Y$$
given by:
$$p \mapsto (f_1(p),..,f_m(p))$$ for some $f_1,...,f_m \subset k[x_1,..,x_n]$.
Now what I don't understand is how do morphism induce a ring homomorphism:
$$k[y_1,..,y_m]/I(Y) \rightarrow k[x_1,..,x_n]/I(X)$$ given by
$$f \mapsto f \circ \phi$$.
I don't even get the intuition behind this, let alone why this would be the case in first place.
I'm really struggling to see why the map above induces a map between the coordinate rings of the two varieties. Can someone try to explain this in a simple language?
 A: One way to think about the elements of the coordinate ring $k[x_1,...,x_n]/I(X)$ is as functions from $X$ to $k$. Indeed, note that every coset $f+I(X)$ defines a function $\hat{f}:X\to k$ by $(a_1,...,a_n)\to f(a_1,...,a_n)$. The definition of $I(X)$ tells us that $\hat{f}$ is indeed well defined. Moreover, this map $\hat{f}$ fully determines the coset $f+I(X)$ in the sense that we have $f+I(X)=g+I(X)$ if and only if $\hat{f}=\hat{g}$ . So usually we don't really denote the map by $\hat{f}$, but rather just think of the elements of $k[x_1,...,x_n]/I(X)$ themselves as of functions from $X$ to $k$. Also, many times we just write $f$ instead of $f+I(X)$.
Once you understand this, the homomorphism from $k[y_1,...,y_m]/I(Y)\to k[x_1,...,x_n]/I(X)$ should become clear. If $f\in k[y_1,...,y_m]/I(Y)$ then $f$ is map $Y\to k$. Thus the composition $f\circ\phi:X\to k$ is defined. Moreover, $f\circ\phi$ is exactly the function which corresponds to the element $f\circ (f_1,...,f_m)+I(X)\in k[x_1,...,x_n]/I(X)$. So if, as before, we identify the elements of the coordinate ring with the corresponding functions, we get that $f\circ\phi$ is indeed an element of $k[x_1,...,x_n]/I(X)$.
Note: By $f\circ (f_1,...,f_m)$ I mean the polynomial $f(f_1(x_1,...,x_n),...,f_m(x_1,...,x_n))\in k[x_1,...,x_n]$.
