Proof (morphisms of affine algebraic sets and algebra homomorphisms between coordinate rings)

The specified maps are indeed inverses: if $f = (f_1, \ldots, f_r)$, then $f^\ast y_i = y_i\circ f = f_i$. Conversely if $f = (λy_1, \ldots, λy_n)$, then $f^\ast y_i = y_i\circ f = λy_i$ so $f^\ast = λ$.

It remains to show the inverse is well-defined, i.e. if $λ: A(Y) \to A(X)$ is a $k$-algebra homomorphism, then $f = (λy_1, \ldots, λy_n)$ is $X\to Y$. For any $g\in I(Y)$, since $λ$ is a $k$-algebra homomorphism, $$ \begin{align*} g \circ f = g(λy_1, \ldots, λy_n) = λ(g(y_1, \ldots, y_n)). \end{align*} $$ As $g = 0$ in $A(Y)$, $λ(g) = 0$ in $A(X)$, i.e. $g \circ f = λ(g) \in I(X)$. This means $f(p) \in Z(I(Y))$${}={}$$Y$ for all $p\in X$ as required.

Finally the correspondence between isomorphisms follows from $(f \circ g)^\ast = g^\ast \circ f^\ast$ and $\id_X^\ast = \id_{A(X)}$.