Background
Let $(X,\mathcal{A})$ be a measure space and $\mathcal{B}$ the Borel $\sigma-$algebra. A function $f: (X,\mathbb{\mathcal{A}}) \rightarrow (\mathbb{R},\mathcal{B})$ is $\mathcal{A}$ measurable if for all real $\alpha$, $\{x:f(x)>\alpha\}\in \mathcal{A}$. In particular, if $\mathcal{L}$ is the Lebesgue $\sigma-$ algebra, $f:(\mathbb{R},\mathcal{L}) \rightarrow (\mathbb{R},\mathcal{B})$ is Lebesgue measurable if it satisfies the above definition.
Claim 1:
If $f:\mathbb{R} \rightarrow \mathbb{R}$ is Lebesgue measurable and $g:\mathbb{R} \rightarrow \mathbb{R}$ is continuous, then $g \circ f$ is Lebesgue measurable.
Proof: Let $\alpha \in \mathbb{R}$. Since the inverse image under a continuous function of an open set is an open set, $G=\{x:g(x)>\alpha\}$ is open and therefore a Borel set. Since $\mathcal{B} \subset \mathcal{L}$, and $f$ is Lebesgue measurable, we see that $f^{-1}(G) \in \mathcal{L}$. Therefore $g \circ f$ is Lebesgue measurable.
Claim 2:
A slight modification of the above proof shows that the above result holds if $g$ is Borel measurable instead of continuous.
Claim 3 If $f:\mathbb{R} \rightarrow \mathbb{R}$ and $g:\mathbb{R} \rightarrow \mathbb{R}$ are both Lebesgue measurable, then $g \circ f$ need not be Lebesgue measurable.
Proof Let $C$ be the cantor set. Note that $C$ has Lebesgue measure $0$. Let $f: [0,1] \rightarrow C$ be the well known strictly increasing function that maps the interval $[0,1]$ onto $C$. Then $f$ is Borel measurable and therefore Lebesgue measurable. Let $V \subset [0,1]$ be the vitali set. Since the Lebesgue measure is complete, we find that $f(V) \subset C$ is lebesgue measurable (with measure zero). Let $g:C \rightarrow \{0,1\}$ be the indicator function for $f(V)$, i.e, $g=\chi_{f(V)}$. Then $g$ is Lebesgue measurable by direct verification. However, $\{x:g\circ f>0\}=V$ which is not Lebesgue measurable.
Question
Doesn't the counterexample in claim 3 contradict claim 2, due to $f$ and $g$ both being Borel measurable?