Do we have full control of the oscillation of a function by modifying it on a small set? Definitions and some motivation:
Let $\mathcal B$ be the set of bounded measurable functions from $[0, 1]$ to $\mathbb R$. Denote by $\mathcal N$ the set of measurable subsets of $[0, 1]$ with Lebesgue measure $0$.
Given a function  $f \in \mathcal B$, define the function $\mathcal Of$ by
$\mathcal Of(x) := \inf_{N \in \mathcal N} \lim_{\delta \to 0} \sup_{y, z \in B_\delta (x) \setminus N}\ |f(y) - f(z)|$.
Thanks to Lusin’s theorem, we know that we can modify $f$ on an arbitrarily small set and get a continuous function, and so we force the oscillation to be $0$ everywhere. But can we force it to be whatever we want, and in a controlled way?
Question:
Does there exist, for any given $f, g \in \mathcal B$ and $\varepsilon > 0$, a function $f’ \in \mathcal B$ such that the following conditions are satisfied?
i) $f’ = f$ everywhere except for a set of measure at most $\varepsilon$.
ii) $\mathcal Of’ = \mathcal Og$.
iii) $\mathcal O(f’ - f) \leq |\mathcal O(g) - \mathcal O(f)|$.
Remark: Condition (iii) intuitively says that we do not modify the values of $f$ any more than strictly necessary.
Note: All functions are genuine functions and not equivalence classes modulo null sets of such.
 A: Let $f,g: [0,1] \to \mathbf{R}$ be two given, bounded measurable functions and $\epsilon > 0$ be an arbitrary constant. By Lusin's theorem there exist continuous functions $F,G: [0,1] \to \mathbf{R}$ so that together
\begin{equation}
\lvert \{ F \neq f \} \rvert + \lvert \{ G \neq g \} \rvert < \epsilon.
\end{equation}
In other words $F - f$ and $G - g$ are zero except on a set of measure at most $\epsilon$. Note also that $\mathcal{O}(G) = \mathcal{O}(F) = 0$ by continuity, so they can be added and subtracted with impunity. Therefore we may set
\begin{equation}
f' = F + g - G = f + (F - f) + (g - G). 
\end{equation}
This function has

*

*$\mathcal{O}(f') = \mathcal{O}(F + g - G) = \mathcal{O}(g)$ because $F,G$ are continuous,

*$\{ f' \neq f \} \subset \{ g \neq G \} \cup \{ f \neq F \}$ so $\lvert \{ f' \neq f \} \rvert < \epsilon$,

*$\mathcal{O}(f - f') = \mathcal{O}(f - F - g + G) = \mathcal{O}(f - g)$ and taking absolute values this is bounded by $\lvert \mathcal{O}(f) - \mathcal{O}(g) \rvert$ by the triangle inequality.

