Any Lebesgue measurable set can be written as the symmetric difference $B \vartriangle N$ of a Borel set $B$ and a null set $N$. Since $g$ is continuous, $g^{-1}(B)$ is then also Borel, and, by assumption, $g^{-1}(N)$ is measurable, so $g^{-1}(B \vartriangle N)=g^{-1}(B) \vartriangle g^{-1}(N)$ is also Lebesgue measurable. This means that applying $g^{-1}$ to a Lebesgue measurable set gives another Lebesgue measurable set. Also, since $f$ is Lebesgue measurable, applying $f^{-1}$ to an open set gives a Lebesgue measurable set. So, if $O$ is open,
$$(f\circ g)^{-1}(O)=g^{-1}(f^{-1}(O))$$
must be Lebesgue measurable, meaning that $f\circ g$ is Lebesgue measurable.