$\varphi\colon M\to N$ continuous surjective and closed. Then $f\colon N\to P$ continuous iff $f\circ\varphi\colon M\to P$ is continuous. (Topological spaces)
I think that this proposition is true like I noted in $\varphi\colon M\to N$ continuous and open. Then $f$ continuous iff $f\circ\varphi$ continuous. (My commentary in Added (2)) which is true if we put $\varphi$ open instead of closed (in this case the proof is straightforward).
I tried a proof to this harder fact but is so large. I was put this as an possible answer to this question.