Let $X,Y$ and $Z$ be topological spaces, and consider the projections $\pi\colon X\times (Y\times Z)\to Y\times Z$ and $\varphi\colon Y\times Z\to Z$.
1) Is it true that if $\varphi$ and $\varphi\circ \pi$ are closed, then $\pi$ is closed?
I guess the answer is negative, but I do not know a counterexample.
2) Note that if $X$ is compact, then $\pi$ is obviously closed. Are there other conditions on $X$ implying that $\pi$ is closed in this context?
I think a counter-example to question 1 would be something like the following.
Let $X=Y=\mathbb{R}$ and let $Z = \ast$ be a point. Then both $\varphi$ and $\varphi \circ \pi$ are morphisms to a point, and so closed. However the morphism $$ \pi = \pi_2: \mathbb{R}^2 \to \mathbb{R} $$ is not closed. For instance, the set $\{xy = 1\}$ is closed, but $\pi$ sends it to $\mathbb{R}\setminus \{0\}$ which is not closed.