TITLE: if f is continuous almost everywhere , must there exist a function g such that g=f almost everywhere and g is continuous?
QUESTION [5 upvotes]: if f is continuous almost everywhere , must there exist a function g such that g=f almost everywhere and g is continuous?
I have one example that shows it could happen. Let f be defined as 1 on irrationals and 0 the rationals. Then the constant function g defined as 1 everywhere is such that: g=f a.e. and g is continuous. Thus the statement may be true but I am not able to show why. Thanks for any tips!

REPLY [8 votes]: No. Consider $f\colon \mathbb R \to \mathbb R$ given by $$ f(x) = \begin{cases} 1 & x \ge 0\\ 0 & x < 0\end{cases} $$
$f$ is continuous on $\mathbb R -\{0\}$, but cannot be made into a continuous function by change on a set of measure zero.