Here I am using Hartshorne's definition of projective morphism, i.e $f : X \to Y$ is projective morphism iff there is a factorisation via $f' : X \to \mathbb P^n_Y$ for some n where $f'$ is a closed immersion.
Prove that projective morphisms are stable under base extension
So we have a projective morphism $f : X \to Y$ and a factorisation via $\mathbb P^n_Y$. Further we have $g : Y' \to Y$. Let $X'$ be the pullback.
How do we get a factorisation via some $\mathbb P^m_{Y'}$?
Question: "How do we get a factorisation via some $\mathbb P^m_{Y'}$?"
Answer: By definition $\mathbb{P}^n_Y:=\mathbb{P}^n_{\mathbb{Z}}\times_{\mathbb{Z}} Y$ and hence
$$Y'\times_Y \mathbb{P}^n_Y \cong \mathbb{P}^n_{\mathbb{Z}}\times_{\mathbb{Z}} Y \times_y Y' \cong \mathbb{P}^n_{\mathbb{Z}}\times_{\mathbb{Z}} Y':=\mathbb{P}^n_{Y'}.$$
It follows you get a canonical map
$$X':=Y'\times_Y X \rightarrow \mathbb{P}^n_{Y'}$$
which is a closed immersion since closed immersions are "stable under base change".