# If the composition of two maps is continuous and one of the maps is also continuous, then is the other continuous

Let $f:X\to Y$ and $g:Y\to Z$ be maps of topological spaces.

Assume that the composition $g\circ f$ is continuous and that $f$ is continuous.

Is $g$ necessarily continuous?

If this is not true in general, is it true under some hypotheses on $X$, $Y$ or $Z$?

Reversely, assume that $g\circ f$ is continuous and $g$ is continuous. Is $f$ continuous?

This is not homework. It's just something I was wondering about.

• Consider what happens when one of the functions is constant. – Samuel Nov 8 '11 at 12:14
• To have a positive answer to the first question, you can suppose $f$ is surjetive and is "submersive" in the sense that it makes the topology on $Y$ a quotient topology of $X$ (i.e. $U\subseteq Y$ is open if and only if $f^{-1}(U)$ is open in $X$). Similarly, for the second question, suppose $g$ is "immersive": $U$ is open in $Y$ if and only if it is the pre-image of an open subset of $Z$. These hypothese make the proof tautological, but maps satisfying these properties are not weird. – user18119 Nov 8 '11 at 12:35

For your first question, suppose $f$ is a constant function. Then $gf$ is also constant, and hence continuous, no matter what $g$ is. So the only hypotheses on $X$, $Y$ and $Z$ that could force $g$ to be continuous are ones that force every function from $Y$ to $Z$ to be continuous.
Similarly, for the second, suppose $g$ is constant. Then again $gf$ is constant, no matter what $f$ is.