Redefining almost monotonic functions on a set of measure $0$ I am given an "almost monotonic" function $f\colon [a,b]\to\mathbb{R}$, as in monotonic everywhere except on a set $M$ of Lebesgue-measure $0$. The paper now simply states that we can redefine the function on that specific set to get a monotonic function $\widetilde{f}\colon [a,b]\to\mathbb{R}$ which agrees with $f$ almost everywhere (everywhere except maybe $M$). While I feel like this should be true, I couldn't find an exact value for $\widetilde{f}(x)$ for every $x\in M$. This value is easy to find if $x$ is an isolated point of $M$, so the task becomes trivial if $M$ consits merely of isolated points, maybe even if $M$ is countable, but what would I do in case $M$ wasn't countable? How do I redefine $f$ in that case?
 A: Note that the choice for $\tilde f(x)$ is not uniquely determined for $x\in M$
(for instance, consider a function with a jump).
Here is one way to do it (w.l.o.g. let $f$ be monotonic non-decreasing):
For $x\in [a,b]$, we define
$$\tilde f(x) := \sup \{ f(y) | y \in [a,b]\setminus M, y \leq x\}.$$
Then it can be shown that $\tilde f(x)=f(x)$ for $x\not\in M$ and that
$\tilde f$ is non-decreasing (those things are not too hard to show, you can probably do that by yourself).
A: As stated the question doesn't quite make sense. Does the paper really say
(i)"Monotonic everywhere except on a set of measure zero"?
Should be
(ii)"Monotonic on $[a,b]\setminus M$, where $M$ has measure zero."
The reason I'm pointing this out is to say that if it actually says (ii) in the paper and you changed it to (i) you shouldn't have! You should be more careful...
The point is that (i) means "monotonic at $x$ for almost every $x$", which is meaningless, since there's  no such thing as "$f$ is monotonic at $x$."
The same issue comes up with (iii) versus (iv), where (iii) and (iv) are the same as (i) and (ii) with the word "monotonic" replaced by "continuous". That's a worse problem, because (iii) and (iv) are both meaningful, but they mean different things. Students sometimes do write (iii) where they should write (iv), and that causes problems...
