Suppose $X$ is some connected topological space, $I$ is an interval and $Y$ is some topological space. Let $g: X\to I$ be a continuous and surjective function. Let $f$ be a function $I \to Y$. If $f \circ g$ is continuous, must $f$ be continuous?
To prove this is suffices to prove that if $x \in I$ and $x_n$ converges to $x$ from either below or above then $f(x_n)$ converges to $f(x)$. Let us assume wlog that $x_n \geq x$ for all $n$. It would be enough to find $y$ and $y_n$ such that $g(y_n)=x_n$, $g(y)=x$ and $y_n \to y$.
There is some $y \in X$ such that $f(y)=x$. In addition we can pick $y$ so that every open set $ U \ni y$ contains a $z$ with $g(z)>x$. (Follows from connectedness.) If $X$ were first-countable I think this would imply the existence of the desired sequence $y_n$. But I cannot see how to conclude this in general.