$\varphi\colon M\to N$ continuous and open. Then $f$ continuous iff $f\circ\varphi$ continuous.

$\varphi\colon M\to N$ continuous and open. Then $f\colon N\to P$ continuous iff $f\circ\varphi\colon M\to P$ continuous.

“Proof:” Let $A\subset P$ open then exists $U\subset M$ such that $(f\circ \varphi)[ U]=f(\varphi[U])\subset A$ where $\varphi[U]\subset N$ is open. The other side is trivial. $\square$

I think that I’m right but my book says:

$\varphi\colon M\to N$ continuous surjective and open. Then $f\colon N\to P$ continuous iff $f\circ\varphi\colon M\to P$ continuous.

I didn’t use surjective property. It is necessary?


Added: According Dylan Moreland second paragraph my proof works when I’m proving for each point of $N$, then my proof is easly to fix.

Correct proof: Let $a\in N$ then for all neighborhood $V$ of $f(a)$ exists $U\subset M$ neighborhood of $\varphi^{-1}(a)\in M$ [exists by surjectivity] such that $(f\circ \varphi)[ U]=f(\varphi[U])\subset V$ where $\varphi[U]\subset N$ is a neighborhood of $a$ since $\varphi$ is open. The other side is trivial. $\square$


Added (2): I think that the fact is true if we say that $\varphi$ is close indeed open function. But the neighborhood proof doesn’t work.

Added (3): I think that I have a proof for the fact that I said in Added (2) and I was put as a question $\varphi:M\to N$ continuous surjective and closed. Then $f$ continuous iff $f\circ\varphi$ continuous.

Solutions Collecting From Web of "$\varphi\colon M\to N$ continuous and open. Then $f$ continuous iff $f\circ\varphi$ continuous."

You need surjectivity of $\varphi$. Consider the following example, with $M=N=P=\Bbb R$. Let $$\varphi:\Bbb R\to\Bbb R:x\mapsto\tan^{-1}x$$ and $$f:\Bbb R\to\Bbb R:x\mapsto\begin{cases}
x,&\text{if }|x|<\frac{\pi}2\\\\
3,&\text{if }|x|\ge\frac{\pi}2\;;
\end{cases}$$

then $f\circ\varphi=\varphi$, which is a homeomorphism from $\Bbb R$ to $\left(-\frac{\pi}2,\frac{\pi}2\right)$ and hence continuous and open as a map from $\Bbb R$ to $\Bbb R$, but $f$ is badly discontinuous at $\pm\frac{\pi}2$.

Added: To show that $f$ is continuous, assuming that $f\circ\varphi$ is continuous, you need to start with an open set $A\subseteq P$ and show that $f^{-1}[P]$ is open in $N$. Let $V=(f\circ\varphi)^{-1}[A]=\varphi^{-1}\big[f^{-1}[A]\big]$; you know that $V$ is open in $M$. Since $\varphi$ is an open map, you also know that $\varphi[V]$ is open in $N$. What you don’t know is that $f\big[\varphi[V]\big]=A$: if $\varphi$ isn’t surjective, $\varphi[V]$ may be only part of $f^{-1}[A]$. In my example, for instance, take $A=(2,4)$. Then $f^{-1}[A]=\left(\leftarrow,\frac{\pi}2\right]\cup\left[\frac{\pi}2,\to\right)$, and $V=\varnothing$, so of course $\varphi[V]=\varnothing$, and $f\big[\varphi[V]\big]=\varnothing\ne A$.

Here’s an example. As sets, let $M = \{a\}$ and $N = P = \{a, b\}$. Give $N$ the topology such that $\{a\}$ is open but $\{b\}$ is not, and give $P$ the discrete topology. Let $\varphi$ be the obvious inclusion and $f$ the identity map.

So while the statements in your proof are correct, they don’t quite prove continuity. It would be enough to show that for each $x \in N$ and neighborhood $V$ of $f(x)$ there exists a neighborhood $U$ of $x$ such that $f(U) \subset V$. But $\varphi$ can’t produce such $U$ for $x$ that it doesn’t hit.