Find $f:\mathbb R \to \mathbb R$ an almost everywhere continuous function such that there isn't any $g:\mathbb R \to \mathbb R$ continuous function with $f=g$ a.e..

My attempt at a solution

I was trying to construct a function $f$ of such characteristics and I thought of a function which is constant on intervals of the form $(n,n+1)$ for $n$ integer and has jumps of height $1$ between any two integers. I didn't know how to explicitly define this function, but the idea is $f$ on $[0,1)$ has the value $0$; on $[1,2)$ takes the value $1$; on $[2,3)$, $0$, and continue this way and define it the same way for the negatives.

It is clear that this function is continuous almost everywhere (except at the integers), but I didn't know how to show that it can't be extended to a continuous function on the real line. I would appreciat any suggestions or help to prove this and also if there is a nice way to define the function I've just constructed.


1 Answer 1


Just take $f=0$ on $(-\infty,0]$ and $f=1$ on $(0,\infty)$. Suppose $g$ is any continuous function such that $g=f$ a.e., then you have two options:

  1. $g(0) \neq 0$: Then there is $\delta > 0$ such that $g(x) \neq 0$ on $(-\delta,0]$ and $f(x) = 0$ on $(-\delta,0]$ contradicting the fact that $g=f$ a.e.

  2. $g(0) = 0$: Then choose $\delta > 0$ such that $|g(x)|< 1/2$ on $[0,\delta)$. Once again this contradicts the assumptions that $g=f$ a.e.

  • $\begingroup$ Thanks!, just one silly question, wouldn't be sufficient in 2. to choose $\delta>0$ such that $|g(x)|<1$? $\endgroup$
    – user16924
    Commented Sep 9, 2015 at 5:28
  • 1
    $\begingroup$ Yes, of course. I was just being extra careful :) $\endgroup$ Commented Sep 9, 2015 at 5:37
  • $\begingroup$ How can we bound $g$ by $1/2$ on $[0, \delta)$. For any such $\delta > 0,[0, \delta) \cap (0, \infty) = (0, \delta)$, an interval on which $g = f$ almost everywhere. $\implies$ there exists at least one point in $x \in (0, \delta)$ such that $g(x) = 1$. $\endgroup$
    – Zduff
    Commented Oct 30, 2018 at 6:58
  • 1
    $\begingroup$ @Zduff: That is precisely the contradiction! $\endgroup$ Commented Nov 1, 2018 at 5:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .