Sharp assumption for preserving Lebesgue measurability by left composition Let $g: [0, 1] \to \mathbb R$ be a Lebesgue-measurable function (in the classical sense: the inverse images of Borel sets are Lebesgue-measurable). It is a classical fact in analysis that $f \circ g$ is Lebesgue-measurable as soon as $f$ is continuous, for instance, or Borel-measurable (the inverse images of Borel sets are Borel), but not necessarily if $f$ is only Lebesgue-measurable. My question is: what is the sharpest assumption that one can put on $f$ guaranteeing that $f \circ g$ is Lebesgue-measurable for every Lebesgue-measurable $g$?
More precisely, consider the class
$$
\begin{aligned}
\mathcal F = \{f: \mathbb R \to \mathbb R \mid {} & g: [0, 1] \to \mathbb R \text{ is Lebesgue-measurable} \implies \\
& f \circ g \text{ is Lebesgue-measurable}\}.
\end{aligned}
$$
$\mathcal F$ contains all Borel-measurable functions, but does it contain other functions? Or is it equal to the set of all Borel-measurable functions?
This question looks quite natural and I imagined there should be some classical result in real analysis providing its answer, but I could not find it in standard textbooks. I initially conjectured that $\mathcal F$ coincides with the set of all Borel-measurable functions. This would mean that, if $f$ is not a Borel-measurable function, then there exists a Lebesgue-measurable $g$ such that $f \circ g$ is not Lebesgue-measurable. The idea would be to pick such an $f$, pick a Borel set $A$ such that $B = f^{-1}(A)$ is not Borel, and try to construct a Lebesgue-measurable $g$ such that $g^{-1}(B)$ is not Lebesgue-measurable, but I cannot see how to construct such a $g$ while keeping its Lebesgue-measurability. Any ideas or any references to this question?
Edit: made the statements about Lebesgue- or Borel-measurability more precise.
 A: The answer is: $\cal F$ is the family of universally measurable functions.

For simplicity, let us consider functions on $[0,1]$ rather than on $\mathbb R$. Let $\cal B$ be the family of Borel sets, $\cal B^\star$ the family of universally measurable sets, and $\cal L$ the family of Lebesgue sets.

Clearly, it is sufficient that $f$ is universally measurable: every $\cal B/\cal L$-measurable function is in fact $\cal B^\star/\cal L$ measurable (for clearly $\cal L^\star = \cal L$); see, for example, the PlanetMath entry.

The above condition turns out to be necessary, too. Indeed: suppose that $f$ is not universally measurable, that is, $A := f^{-1}(B) \notin \cal B^\star$ for some $B \in \cal B$. We will construct a continuous (!) function $g$ such that $g^{-1}(A)$ is not in $\cal L$. Of course, this implies that $f \notin \cal F$.
There is a Borel probability measure $\mu$ such that $A$ is not $\mu$-measurable. Let $\lambda$ be the Lebesgue measure on $[0, 1]$. Considering $\tfrac{1}{2} \mu + \tfrac{1}{2} \lambda$ rather than $\mu$, we may assume that the distribution function $h$ of $\mu$ is strictly increasing. Removing the atoms of $\mu$ and renormalising it, we can make $\mu$ atomless and $h$ is continuous.
We have $\mu(E) = \lambda(h(E))$ for every Borel set $E$. If $h(A)$ were Lebesgue measurable, we would have two Borel sets $F_1$ and $F_2$ such that $F_1 \subseteq h(A) \subseteq F_2$ and $\lambda(F_2 \setminus F_1) = 0$. But then $E_1 = h^{-1}(F_1)$ and $E_2 = h^{-1}(F_2)$ would be Borel sets such that $E_1 \subseteq A \subseteq E_2$ and $$\mu(E_2 \setminus E_1) = \lambda(h(E_2 \setminus E_1)) = \lambda(F_2 \setminus F_1) = 0 ,$$ and consequently $A$ would be $\mu$-measurable.
Now if $g$ is the inverse of $h$, then $g$ is continuous and strictly increasing, and $g^{-1}(A) = h(A)$ is not Lebesgue-measurable.
A: Take any $f\in\mathcal F$. Take any real $b$ and any real $a>0$, and let $g(x):=ax+b$ for $x\in[0,1]$. Then the function $g\colon[0,1]\to\mathbb R$ is Borel-measurable and hence the function $h:=f\circ g$ is Borel-measurable. So, for any Borel set $A\subseteq\mathbb R$, the set
$$f^{-1}(A)\cap[b,a+b]=ah^{-1}(A)+b:=\{ax+b\colon x\in h^{-1}(A)\}$$
is Borel, for any interval $[b,a+b]$, which implies that the set $f^{-1}(A)$ is Borel. So, $f$ is Borel-measurable.
Thus, $\mathcal F$ coincides with the set of all Borel-measurable from $\mathbb R$ to $\mathbb R$.
