TITLE: If $f$ is Lebesgue measurable on $[0,1]$ then there exists a Borel measurable function $g$ such that $f=g$ a.e.?
QUESTION [17 upvotes]: If $f:[0,1]\to\mathbb{R}$ is Lebesgue measurable then there exists a Borel measurable function $g:[0,1]\to\mathbb{R}$ such that $f=g$ a.e.?

REPLY [5 votes]: I saw this get bumped, so I thought I'd add in a more general statement that implies this:

Proposition: Let $\mu$ be a measure on $(X,\mathfrak{F})$, and $\bar{\mu}$ its completion on $(X,\overline{\mathfrak{F}}).$ If $f:X\rightarrow\mathbb{R}$ is $\overline{\mathfrak{F}}$-measurable, then there exists $f_0$ that is $\mathfrak{F}$ measurable such that $f_0=f$ $\bar{\mu}$ almost everywhere. 

Proving this result implies the result of the post, since the Lebesgue $\sigma$-algebra is the completion of the Borel $\sigma$-algebra. The proof is relatively easy. Here's how it goes:
First, we start with characteristic functions. Let $A\in\overline{\mathfrak{F}}$ and $f(x)=\chi_A(x).$  So, $A=A'\cup E',$ with $A'\in\mathfrak{F}$ and $E'\subseteq E,$ with $E$ having $\mu$-measure zero. 
We note that $f$ is $\overline{\mathfrak{F}}$ measurable. Indeed, let $U\subseteq\mathbb{R}$ be open. If $0\in U,$ then $f^{-1}(U)=X\setminus A\in\overline{\mathfrak{F}}$. If $1\in U,$ then $f^{-1}(U)=A\in\overline{\mathfrak{F}}$. Finally, if $0,1\in U,$ then $f^{-1}(U)=X\in \overline{\mathfrak{F}}$. Now, define $f_0$ by 
$f_0(x)=\chi_{A'}(x).$ Via a similar argument to the above, $f_0$ is immediately seen to be an $\mathfrak{F}$-measurable function. Further, $f(x)=f_0(x)$, for all $x\notin E',$ and $\bar{\mu}(E')=0.$
Next, simple functions: let $f$ be simple, say $f(x)=\sum\limits_{i=1}^n a_i\chi_{A_i}(x),$ where $a_i\geq 0,$
$A_i\in\overline{\mathfrak{F}}$, with $A_i=A_i'\cup E_i',$ with $A_i'\in\mathfrak{F}$ and
 $E_i'\subseteq E_i,$ with $\mu (E_i)=0$ for all $1\leq i\leq n.$ Without loss of generality, suppose that $\{A_i\}_{i=1}^n$ are pairwise disjoint. Since $f$ is a finite sum of $\overline{\mathfrak{F}}$-measurable functions, $f$ is, as well. Define $f_0(x)=\sum\limits_{i=1}^n a_i\chi_{A_i'}(x),$ which (for the same reason as above) is $\mathfrak{F}$-measurable. Further, $f(x)=f_0(x)$ for all $x\notin\bigcup\limits_{i=1}^n E_i',$ and $\bar{\mu}\left(\bigcup\limits_{i=1}^n E_i'\right) \leq\sum\limits_{i=1}^n\bar{\mu}(E_i')=0,$ and so $\bar{\mu}\left(\bigcup\limits_{i=1}^n E_i'\right)=0.$
Now, let $f$ be $\overline{\mathfrak{F}}$-measurable, and $f\geq 0$. Then, there exist $s_j\in\mathfrak{S}^+(X)$ for which $s_j\nearrow f$ pointwise. For all such $j$, we can write $s_j(x)=\sum\limits_{i=1}^{n_j} a_i^j\chi_{A_i^j}(x),$ 
where $a_i^j\geq 0,$
$A_i^j\in\overline{\mathfrak{F}}$, with $A_i^j=(A_i^j)'\cup (E_i^j)',$ with $(A_i^j)'\in\mathfrak{F}$ and
 $(E_i^j)'\subseteq E_i^j,$ with $\mu (E_i^j)=0$ for all $1\leq i\leq n_j,$ and (once again) we may assume, without loss of generality, that for each such $j$, $\{A_i^j\}_{i=1}^{n_j}$ are pairwise disjoint. Define the sequence $({\tilde{s}}_j)$ by
 $\tilde{s}_j(x)= \sum\limits_{i=1}^{n_j} a_i^j\chi_{(A_i^j)'}(x),$ again $\mathfrak{F}$-measurable. Note that $\tilde{s}_j(x)=s_j(x)$ $\bar{\mu}$-almost everywhere, by a similar argument to our simple function case. Define $f_0(x)=\limsup_j\tilde{s}_j(x).$ Since each ${\tilde{s}}_j$ is ${\mathfrak{F}}$-measurable, so is $f_0,$ as it is the limsup. Further, for all $j$, since $\tilde{s_j}(x)=s_j(x)$ $\bar{\mu}$-almost everywhere, taking the limsup yields that $f_0=f$ $\bar{\mu}$-almost everywhere. 
Finally, if $f:X\rightarrow\mathbb{R}$ is $\overline{\mathfrak{F}}$-measurable. Let $f=f^+-f^-,$ 
where $f^+=\max (f,0)$, and $f^{-} =-\min (f,0).$  Both are readily seen to be both non-negative and  $\overline{\mathfrak{F}}$-measurable. Via the previous argument, we can find $f_0^{+}$ and $f_0^-$ so that $f_0^{\pm}=f^{\pm}$ $\bar{\mu}$-almost everywhere. Defining $f_0=f_0^+-f_0^-$ leads to a function that matches $f$ everywhere, except on the union of two $\bar{\mu}$-measure zero sets, and so they are equal $\bar{\mu}$-almost everywhere.