Is $g\in C(\mathbb{R})$ if $f=g$ a.e and $f\in C^{\infty}(\mathbb{R})$? I have two functions $f,g:\mathbb{R}\to\mathbb{R}$ where $f\in C^{\infty}(\mathbb{R})$ and $f(x)=g(x)$ for almost $x\in\mathbb{R}$ with respect to the Lebesgue measure, and $0<\int_{\mathbb{R}}g(x)dx<\infty$. Is the function $g$ continuous on $\mathbb{R}$? Thank for helping.
(My intuition is that $g$ continuous on $\mathbb{R}$, but I can not prove this).
 A: Pick your favorite smooth $f$ with $\infty > \int_{\Bbb R} fdx > 0$. $f(x) = e^{-x^2}$ is a popular example. Now modify $f$ on a set of measure zero; for instance, you might pick $$g(x) = \left\{
     \begin{array}{lr}
       0 & : x \in \mathbb{Q}\\
       e^{-x^2} & : x \notin \mathbb{Q}
     \end{array}
   \right.
$$ 
Then $\infty > \int g = \int f > 0$, but $g$ is not even a little continuous.
More generally... 
If $f$ is continuous, and $g$ disagrees with $f$ on a set of measure zero, then $g$ is continuous iff $f=g$. Of course, if $f=g$, we're done. But suppose not; then $f-g$ is zero almost everywhere. If $g$ was continuous, then $f-g$ would be continuous; pick a point for which $(f-g)(x) \neq 0$; say WLOG $(f-g)(x_0) > 0$. Then by continuity, on a small enough interval $[a,b]$, with $x_0 \in [a,b]$, $(f-g)(x) > c$ for some positive constant $c$. This contradicts $f-g$ being zero almost everywhere, as $[a,b]$ has positive measure.
So modifying a continuous function on a set of measure zero results in something discontinuous - unless you didn't modify anything at all.
A: Suppose $f(x)=1$ and $g(x)=1$ if $x\notin \mathbb{Q}$ and $g(x)=0$ if $x\in\mathbb{Q}$.
Clearly $f(x)=g(x) \: a.e$ but $g$ is not constinuous.
