We consider only the set $M$ of a.e. essentially locally bounded measurable functions $[0, 1] \to \mathbb R$. Here $m(S)$ denotes the Lebesgue measure of $S$.


Let $f$ be measurable. For every $e$ in $(0, 1]$, by Lusin’s theorem, we can write our measurable function as continuous on $[0, 1]-H$, and horrid on a set $H$ of measure $e$. How does “horrid” vary with $e$?


One way to quantify “horrid” is to ask how discontinuous the function is on $H$. Inspired by this, we calculate the average pointwise oscillation of the function of $H$. Formally this is the integral of the essential oscillation of $f$ on $H$ divided by $m(H)$. Since oscillation is upper semi continuous, it is integrable. Further we take the infimum over all such $H$ of measure less than or equal to $e$.


Thus 
$$
O(f, e) \mathrel{:=} \inf\_{\substack{m(H) \le e,\\ f\in C^0[0, 1] \setminus H}}\left\{\ \frac{1}{m(H)} \int\limits\_{x \in H} \lim\_{d \to 0}\ \inf\_{m(G) = 0} \sup\_{\substack{y, z \in B\_d (x)\setminus G}} \lvert f(y) - f(z)\rvert\mathrm{d}x\right\}.
$$


The end result is that for every $e$, we get a function $O(f): (0, 1] \to [0, \infty) $ describing how horrible the discontinuity behaviour is on the best behaved $H$ we can find.


**Question:**


Call a function $f$ *tame* if $O(f, e) = 0$ for all $e$. Is it true that a function is tame iff it agrees a.e. with a function that is continuous a.e.?



A question concerning Lusin’s Theorem
A counterexample to this problem can be constructed as follows. Take a sequence $(K\_n)\_{n\in\omega}$ of pairwise disjoint nowhere dense compact sets $K\_n\subset[0,1]$ of positive Lebesgue measure $\lambda(K\_n)>0$ such that $\sum\_{n=0}^\infty\lambda(K\_n)=1$. Consider the function $f:[0,1]\to [0,1]$ defined by $$
f(x)=\begin{cases}\frac1{2^n}&\mbox{if $x\in K\_n$ for some $n\in\omega$;}\\
0&\mbox{otherwise}.
\end{cases}
$$


It is easy to see that the function $f$ is not continuous a.e.


On the other hand, for every $\varepsilon >0$, we can choose $n\in\mathbb N$ so large that $\frac1{2^n}<\varepsilon$ and $\sum\_{i>n}\lambda(K\_i)<\varepsilon$. Then the set $H=[0,1]\setminus \bigcup\_{i\le n}K\_i$ has measure $\lambda(H)<\varepsilon$ and $f$ has oscillation $\le \frac1{2^n}<\varepsilon$ at points of the open set $H$ (because $f(H)\subset [0,\frac1{2^n}]$).


