We know that for open subschemes $U\subset X, V\subset Y$, $U\times_S V =p_X^{-1}(U)\cap p_Y^{-1}(V)$ by directly verifying its universal property. We have to use that if the image of a morphism is contained in an open subset, we can restrict the codomain to that open subet. But if we change open to closed subset, the domain needs to be reduced.
My question is that if it still works if we change $U,V$ to closed subset. Or more generally, $f:X\to Z_1, g: Y\to Z_2$ morphism of schemes. $p_1:Z_1\times Z_2 \to Z_1, p_2:Z_1\times Z_2 \to Z_2$. Is it true that $p_1^{-1}(Imf)\cap p_2^{-1}(Img)=Im(f\times g)$. We can assume the schemes are over a field $k$.
At least from the arguments in stackproject I feel it's true. https://stacks.math.columbia.edu/tag/047B https://stacks.math.columbia.edu/tag/04Q0