Before I start I'd like to mention that I am following Gathmann's Notes
Gathmann points out in Definition 4.16 how his more general definition of an affine variety (Ringed topological space that is isomorphic to the vanishing set of a set of polynomials) also agrees with theorems he has proved earlier.
So I went back and attempted to prove the previous theorems using the more general definition of an affine variety and I am stuck on Proposition 4.10
Proposition 4.10: Let $X$ and $Y$ be affine varieties, and let $\pi_X : X \times Y \rightarrow X$ and $\pi_Y : X \times Y \rightarrow Y$ be the projection morphisms from the product onto the two factors. Then for every affine variety $Z$ and two morphisms $f_X : Z \rightarrow X$ and $f_Y : Z \rightarrow Y$ there is a unique morphism $f : Z \rightarrow X \times Y$ such that $f_X = \pi_X \circ f$ and $f_Y = \pi_Y \circ f$.
In particular, suppose I am given $X, Y$ which are affine varieties with their respective sheaves of $K$-valued functions, $\mathcal O_X$ and $\mathcal O_Y$. What would the sheaf of $K$-valued functions look like for $X \times Y$.
Since I have no idea what the sheaf looks like, this is only a shot in the dark at rest of the proof. But suppose $X, Y$ are affine varieties that are isomorphic to $X', Y'$ such that both $X'$ and $Y'$ are vanishing sets of sets of polynomials. Then I'm guessing $X \times Y$ would be isomorphic to $X' \times Y'$. So if I'm given morphisms $f_X : Z \rightarrow X $ and $f_Y: Z \rightarrow Y$, I can extend them to the morphisms $f_{X'}:Z \rightarrow X'$ and $f_{Y'}: Z \rightarrow Y'$ respectively.
My earlier instance of proving the theorem for vanishing sets (since for that proof, assuming $Z$ is a general affine variety is not a problem) will tell me that there is a unique morphism $f': Z \rightarrow X' \times Y'$ such that $f_{X'} = \pi_{X'} \circ f'$ and $f_{Y'} = \pi_{Y'} \circ f'$ If $g: X' \times Y' \rightarrow X \times Y$ is an isomorphism then $f = g \circ f' : Z \rightarrow X \times Y$ is a morphism.
I'm stuck at this point and don't know how to proceed to showing that $f$ has the required properties and is unique. Any help would be appreciated. Thank you very much! Sorry if this post is too long.