If $g$ and $g\circ f$ are continuous function, then $f$ is a continuous function

fake-proofsgeneral-topologysolution-verification

Let be $g:Y\rightarrow Z$ a continuous function beetween two topological spaces and we suppose that the function $f:X\rightarrow Y$ beetween the topological spaces $X$ and $Y$ is such that its composition with $g$ is continuous: so is $f$ continuous?

If $g\circ f$ is continuous so for any open set $U$ in $Z$ it result that $(g\circ f)^{-1}(U)=f^{-1}(g^{-1}(U))$ is an open set in $X$ so by the continuity of $g$ we can ovserve that the the inverse imagine by $f$ of the open set $g^{-1}(U)$ is an open set: so could I conclude that $f$ is continuous?

Howewer I doubt that if $g$ is not bijective I don't say anything about the continuity of $f$.

Could someone help me?

Best Answer

Hint: Consider the fact that any constant function is always going to be continuous.