Why do we use the Borel sigma algebra for the codomain of a measurable function? In several measure theory books, I see that a measurable function $f:\mathbb{R} \rightarrow \mathbb{R}$ often equips the domain with the Lebesgue $\sigma$-algebra and the codomain with the Borel  $\sigma$-algebra. However, if $g$ is another such function, then the composition of $f$ and $g$ may fail to be measurable. 
Why do we not use the Lebesgue $\sigma$-algebra for both the domain and the codomain?

Because if we did there would be fewer measurable functions, and in particular a continuous function $f:\Bbb R\to\Bbb R$ would not necessarily be measurable:
Say $K$ is a "fat Cantor set", that is a subset of $\Bbb R$ homeomorphic to the middle-thirds Cantor set $C$ but such that $m(K)>0$. There is a continuous bijection $f:\Bbb R\to\Bbb R$ such that $f(K)=C$. Now $K$ contains a non-measurable set $E$. Say $F=f(E)$. Then $F$ is Lebesgue measurable, being a subset of a null set, but its inverse image $E$ is not Lebesgue measurable. So $f$ is continuous but not Lebesgue-to-Lebesgue measurable.
Not what we want; if continuous functions are not measurable none of the things we want to use this stuff for work anymore.
(Also it's fun to ask students to resolve the "paradox" that according to the definition of a measurable function between measurable spaces, no topology, the composition of two measurable functions is obviously measurable, yet in this context the composition of two measurable functions need not be measurable.)
