# $f:X\to Y$ continuous, $X$ compact, $g:Y\to Z$ such that $g\circ f$ is continuous $\implies$ $g$ is continuous

Let $f:X\to Y$ be continuous map onto $Y$, and let $X$ be compact. Also $g:Y\to Z$ is such that $g\circ f$ is continuous. I have to show that $g$ is continuous.

Facts obvious from the assumptions:

• As continuous image of compact set is compact, $Y$ and $g(Y)\subseteq Z$ are compact.
• Let $B$ be an open subset of $g(Y)$, then $f^{-1}(g^{-1}(B))$ is an open subset of $X$.

How do I show that $g^{-1}(B)$ is open in $Y$? I have to use the property of compactness somewhere, but not sure how.

• Is $f$ surjective? Otherwise, take $f$ to be a constant function, so that $g \circ f$ is continuous no matter what $g$ is. – GNUSupporter 8964民主女神 地下教會 May 6 '18 at 18:36
• I think $f$ has to be injective as well. – user250285 May 6 '18 at 18:39
• Is $Y$ Hausdorff or simply a metric space ? – harmonicuser May 6 '18 at 18:44
• Let $C \subseteq Z$, is a closed set . Then $g^{-1}(C)=f(C')$ for some $C'$ in $X$. Now $f^{-1}(g^{-1}(C))=C',$ thus $C'$ is closed.Therefore $C'$ is compact $\Rightarrow f(C')$ is compact, thus closed. So $g^{-1}(C)$ is closed.Assuming both surjectivity and injectivity. – user250285 May 6 '18 at 18:45
• Last step requires that the space $Y$ be Hausdorff. In general I don't think compact sets are closed. – harmonicuser May 6 '18 at 18:48

I will assume $Y$ is additionally Hausdorff. Otherwise I don't think this is true or at least I don't see how it works in non-Hausdorff case.
In this situation since $X$ is compact then $f:X\to Y$ is a closed map by the closed map lemma (the assumption about $Y$ being Hausdorff kicks in here). And since $f$ is onto then $f$ is a quotient map, meaning $U\subseteq Y$ is open if and only if $f^{-1}(U)$ is open in $X$.
With that take an open subset $V\subseteq Z$. Then $(g\circ f)^{-1}(V)$ is open in $X$ since we assumed $g\circ f$ is continuous, i.e. $f^{-1}(g^{-1}(V))$ is open in $X$. Since $f$ is a quotient map then this is if and only if $g^{-1}(V)$ is open in $Y$ and thus $g$ is continuous.