Let $\pi:X\to Y$ and $f:X\to\mathbb{R}$ be continuous, is there $g:Y\to \mathbb{R}$ with $f=g\circ \pi$? Let $X$, $Y$ be topological spaces and $\pi:X\to Y$ be a surjective continuous map. It is clear that if $g:Y\to \mathbb{R}$ be a continuous function, then $f=g\circ \pi:X\to \mathbb{R}$ is a continuous function.
Let $f:X\to \mathbb{R}$ be a continuous function, Is there a continuous function $g:Y\to \mathbb{R}$  such that $f=g\circ \pi$?
It seems that there is no such function in general, but I do not know any proof for it.
Is there conditions on $\pi:X\to Y$ to imply that for every continuous function $f:X\to\mathbb{R}$ there is a continuous function $g:Y\to \mathbb{R}$  such that $f=g\circ \pi$?
 A: A simple counterexample is when $\pi$ is constant (and so $Y=\{*\}$ is a singleton) while $f$ is not. Because if $\pi$ is constant then the composition of $\pi$ with any function is constant as well.
As for conditions you may want to read about various lifting properties or maybe projective objects in topological spaces. Note that such properties are rather rare in general.
A: To expand on my comment, if there are $x,x’ \in X$ such that $f(x)\neq f(x’)$ and $\pi(x)=\pi(x’)$, then such a $g$ cannot exist. The other answer is an example of this situation.
Conversely, if $f$ is constant on the fibers of $\pi$ (ie if $\pi(x)=\pi(x’)$ implies $f(x)=f(x’)$ for every $x,x’ \in X$), then such a function $g$ exists and is unique, at least set-theoretically. The question is then to find whether this $g$ is continuous. If $U \subset \mathbb{R}$ is an open subset, $g^{-1}(U)=\pi(\pi^{-1}g^{-1}(U))=\pi(f^{-1}(U))$.
Thus, $g$ is continuous iff for every open subset $U \subset \mathbb{R}$, $\pi(f^{-1}(U))$ is an open subset of $Y$. For instance, it is sufficient that $f$ be open (and the condition above must hold too).
