Let $K$ be any algebraically closed ground field. For $X \subset \mathbb{A}^n$ and $Y \subset \mathbb{A}^{m}$ irreducible affine varities, I am trying to show that the product affine variety $X \times Y$ is also irreducible by showing that the coordinate ring $A(X \times Y) = K[x_1,...,x_{n+m}]/I(X \times Y)$ is an integral domain.
I am trying to do this by contraposition but am stuck. Here is what I have:
Since $X$ and $Y$ are affine varities so $X=V(S)$ and $Y=V(T)$ for some subsets $S \subset K[x_1,...,x_n]$ and $T \subset K[x_1,...,x_m]$. Then $X \times Y = V(P)$ where $P \subset K[x_1,...,x_{n+m}]$ is the set of all polynomials from $S$ considered as polynomials in $n+m$ variables by setting the last $m$ variables equal to zero, along with the polynomials from $T$ considered as polynomials in $n+m$ variables by setting the first $n$ variables equal to zero.
We also have that $V(P)=V((P))$ where $(P)$ is the ideal generated by $P$. Hence
$A(X \times Y)=K[x_1,...,x_{n+m}]/I(X \times Y) = K[x_{1},...,x_{n+m}]/\sqrt(P)$ by Hilbert's Nullstellensatz. Assuming $A(X \times Y)$ is not an integral domain there exits $f,g \neq 0$ such that $f,g \in \sqrt(P)$; moreover we can assume that this implies that $fg \in (P)$ since, if not, then since for some $k$ we have $(fg)^k = f^kg^k \in (P) \subset \sqrt(P)$, $f^k$ and $g^k$ are also zero divisors so we just choose $f=f^k$ and $g=g^k$ instead.
I'm not sure if what I've done so far points me in the right direction, but I am at a loss for seeing how to show that $X$ or $Y$ must be reducible.
Edit: My question was unfairly marked as a duplicate thread. None of the threads cited as alleged duplicates address how to prove that this is irreducible by showing that the coordinate ring of the product is an integral domain.