I am doing exercise $5.5.9$ of these lecture notes. I have produced my own solution but it just seems to trivial and there are possibly some mistakes in my reasoning. I would very much appreciate if someone could point them out/tell me if I am right.
For i) I am constructing the set $$(X\times_S Y)':=\{ (x,y)\in \mathbb{A}^{n+m} \: | \: \bar{f}(x)=\bar{g}(y)\}$$ where $\bar{f}$, $\bar{g}$ denote the extension of $f$ and $g$. Then I define $h(x,y)=\bar{f}(x)-\bar{g}(y)$ and we have that $(X\times_S Y)=Z(h)$, so it is a closed subset of $\mathbb{A}^{n+m}$. In this step you possibly need to be more careful and define another extension of $\bar{f},\bar{g}$ to $\mathbb{A}^{m+n}$ but for simplicity I am omitting that. Finally, $X\times_S Y=(X\times_S Y)\cap (X\times Y)$, so it is a closed subset because it is the intersection of two closed subsets.
For ii) I am using that since $(X\times_S Y)$ is closed in $\mathbb{A}^{n+m}$, its regular functions are polynomials. So by Proposition 4.3.9 in the same lecture notes, the projections are morphisms.
For iii) I am using that the only way to define $h$ is $h(P)=(\varphi(P),\psi(P))$. Therefore $h$ exists and is unique.