Do continuous maps factor through continuous surjections via Borel maps? Let $f \colon X \twoheadrightarrow Y$ be a continuous surjection between compact Hausdorff spaces, and $g \colon \mathbb{R} \to Y$ a continuous function. Can you always find a Borel-measurable function $h \colon \mathbb{R} \to X$ with $g=f \circ h$?

 A: The answer is yes if we also assume $X$ to be metrizable (while other hypotheses may be weakened). 
The multivalued map $\psi:\mathbb{R}\to 2^X$ defined by $\psi(t):=f^{-1}(g(t))$ for all $t \in\mathbb{R}$,  takes values in non-empty closed subsets of $X$, because $f$is surjective and continuous. It is weakly Borel measurable, that is, for any open set $U$ of $X$ the set
$$\{t\in\mathbb{R}: \psi(t)\cap U\neq\emptyset\}$$
is a Borel subset of $\mathbb{R}$. Indeed, for this map $\psi$, the  latter set is $g^{-1}(f(U))$,  which is a Borel set  provided $X$ is a compact metrizable space: then every open $U$ set of its is a countable union of compact sets, $f(U)$ is an $F_\sigma$ and so is $g^{-1}(f(U))$). 
We can therefore apply the Kuratowski and Ryll-Nardzewski selection theorem and state the existence of a  Borel measurable selection $h:\mathbb{R}\to X$ of $\psi$, that is $h(t)\in f^{-1}(g(t))$ for all $t\in\mathbb{R}$, that is $f\circ h= g$.
rmk. As shown in the above argument, what is needed to apply the KRN measurable selection theorem is: $f$ is continuous and surjective and for any $U\subset X$ open subset, $g^{-1}(f(U))\in\mathcal{B}(\mathbb{R})$. 
Also, as suggested by user abx in comment, one can directly prove that $f$ has a Borel measurable section $s:Y\to X$, replacing  $g:\mathbb{R}\to Y$ in the argument with the identity map $Y\to Y$. In order to apply the KRN thm one needs to know that for all $U\subset X$ open subset, $ f(U) \in\mathcal{B}(Y)$ (which is true for metrizable $X$). 
A: Just a small addition to the existing answers.

Theorem. There exists a non-metrizable compact Hausdorff space $K$ admitting a continuous surjective function $f:K\to[0,1]^2$ to the unit square such that $f$ has a Borel section if and only if CH holds. Then taking the Peano square-filling curve $p:[0,1]\to[0,1]^2$ we can show that $p$ has a Borel $f$-lifting $[0,1]\to K$ if and only if the Continuum Hypothesis holds.

Skecth of the proof. Consider the split interval $\ddot{\mathbb I}$ (which is the lexicographic product $[0,1]\times\{0,1\}$ endowed with the order topology). It is well-known that $\ddot{\mathbb I}$ is a compact Hausdorff space admitting a continuous surjective map $\ddot{\mathbb I}\to [0,1]$. Then the square $K=\ddot{\mathbb I}\times\ddot{\mathbb I}$ admits a continuous surjective map $f:K\to[0,1]^2$ such that for every point $z\in[0,1]^2$ the preimage $f^{-1}(z)$ contains at most 4 points. Using the answer (and comments) to this question, it can be shown that $f$ has the desired property: it has a Borel section if and only if CH holds. More details on the proof can be found in this paper. $\quad\square$

The above theorem suggests the following (open?)

Problem. Is there a 2-to-1 map $f:K\to M$ from a compact (Rosenthal) space onto a compact metrizable space $M$, which has no Borel selections? 


