I've read about closed immersions being stable under base changes, but I have the following question.
Suppose $f: X \to Y$ is a morphism of $S$-schemes such that $f$ is an immersion and assume furthermore that $f$ is proper. Can we conclude that the base change $\operatorname{Id} \times_S f: X \times_S X \to X \times_S Y$ is a closed immersion?
I already know it should be an immersion since these are stable under base changes, but can we lift "immersion" to "closed immersion" using the fact that $f$ is proper?
Thanks in advance!