TITLE: If $p_i:X\rightarrow Y_i$($i=1,2$) are immersions, is $X\rightarrow Y_1 \times Y_2$ immersion?
QUESTION [5 upvotes]: If $p_i:X\rightarrow Y_i$($i=1,2$) are immersion of $S$-schemes, is $X\rightarrow Y_1 \times_{S} Y_2$ an immersion?
I don't know if it is true.I tried to treat the affine case, $X,Y_i,S$ are spectrum of rings$A,B_i,C$. But I don't know what the general immersion is in the dictionary of rings. 
Suppose the immersion are closed, then $p_i$ corresponding to surjective homomorphisms$B_i\rightarrow A$, so the induced map from tensor product$B_1\otimes_{C}B_2$ is also surjective to A,which is a closed immersion.

REPLY [2 votes]: More generally, it suffices to demand one of the maps to be an immersion:
If $f: X \to Y$ is an immersion, and $g: X \to Z$ is any morphism (all over $S$), then $X \to Y \times_S Z$ is an immersion.
Proof: $X \to Y \times_S Z$ is the composition of the graph-morphism $\Gamma_g = (\text{id}_X, g): X \to X \times_S Z$ with the product morphism $f \times \text{id}_Z: X \times_S Z \to Y \times_S Z$. We will show that both $\Gamma_g$ and $f \times \text{id}_Z$ are immersions.
For $f \times \text{id}_Z$ this is true, because  a product of two immersions is an immersion.
The morphism $\Gamma_g$ can be obtained by base extension of the diagonal map $\Delta: Z \to Z \times_S Z$ along $X \times_S Z \xrightarrow{g \times \text{id}_Z} Z \times_S Z$, i.e. the following commutative diagram is cartesian:
$$
\begin{matrix}
X & \longrightarrow & Z \\
\Gamma_g \downarrow &&\downarrow  \Delta \\
X \times Z & \longrightarrow &Z \times Z
\end{matrix}
$$
To conclude, $X \to Y \times_S Z$ is the composition of two immersions, so an immersion as well.
Note: The following is not true: if $f: X \to Y$ is a closed immersion, then $(f,g):X \to Y \times_S Z$ is a closed immersion. For this we would need that $Z$ is separated over $S$, so $\Delta: Z \to Z \times_S Z$ is a closed immersion.