If $f$ is a function that is defined almost everywhere, and $g$ and $h$ are function that are defined on all of $R^n$ in such a way that $g=f \text{ almost everywhere}$ , and $h=f\text{ almost everywhere}$.
Then prove that if $g$ is measurable then $h$ is also measurable.
Lebesgue-measurable sets $A_1,A_2$ must exist with:
Then also $A=A_1\cup A_2$ is Lebesgue-measurable, and this with:
Since the Lebesgue-measure is complete the function $h1_A$ is measurable.
If moreover $g$ is measurable then $h1_{A^c}=g1_{A^c}$ is measurable, and also $h=h1_{A^c}+h1_A$.