Hartshorne- Algebraic Geometry, Exercise 1.3.15 Part c) of this question asks you to prove that the product of affine varieties is a categorical product.
I am having trouble in proving the mediator from an arbitrary $Z \rightarrow X \times Y$ is in fact a morphism. 
I feel like the fact that $Z$ has the Zariski Topology means that it's large enough to be able to guarantee that this map is continuous but I can't see how to reduce a closed (or open) set $V \subset X \times Y, V = Z(a)$ for some ideal $a \subset k[x_1,...,x_{n+m}]$ into parts where I can use the continuity of the given maps $Z \rightarrow X , Z \rightarrow Y$.
I'm also not sure about how to prove the regular bit too but I feel it should come a lot easier once I can get the continuity bit and see how the open/closed sets are supposed to split up.
 A: Hint: One possibility is to use part Lemma 3.6 or part $(b)$ of the exercise (the natural isomorphism between $A(X)\otimes_k A(Y)$ and $A(X\times Y)$) and Proposition 3.5.
Added later:
Since there have been some uncertainties concerning the arguments used in the comments, let me sketch what was said there, with some extra care where we are abusing notation. For simplicity, assume $X = \mathbb{A}^n$ and $Y = \mathbb{A}^m$ with coordinate rings $k[x_1,\dots,x_n]$ and $k[y_1,\dots,y_m]$; the exercise constructs(!) $\mathbb{A}^n\times\mathbb{A}^m$ as $\mathbb{A}^{n+m}$ with coordinate ring $k[x_1,\dots,x_n,y_1,\dots,y_m]$ by slight abuse of notation (in fact, the global coordinate function represented by $x_i$ on $X\times Y$ is secretly the regular map $x_i\circ p_1$ and likewise for the coordinates $y_i$).
Thus, Lemma 3.6 implies that a map $\phi\colon Z\to X\times Y$ is a morphism if and only if all the maps $x_i\circ p_1\circ \phi$, $i=1,2,\dots,n$, and $y_i\circ p_2\circ \phi$, $i=1,2,\dots,m$, are regular functions. Applying Lemma 3.6 again, this is seen to be the case if and only if $p_1\circ \phi\colon Z\to X$ and $p_2\circ \phi\colon Z\to Y$ are morphisms, and this is exactly what we have to show.
