Does every differentiable a.e. function admit a maximally differentiable representative? For $f: \mathbb R \to \mathbb R$ a measurable function, we say $g: \mathbb R \to \mathbb R$ is a modification of $f$ if $f = g$ a.e.
Suppose $f$ Is a measurable function that is differentiable a.e.
We say that a modification $g$ of $f$ is maximally differentiable if whenever $h$ is another modification of $f$, we have that for all $x \in \mathbb R$, if $h$ is differentiable at $x$, then so is $g$.
Question: Does every measurable, differentiable a.e. function $f$ admit a modification that is maximally differentiable?
 A: $\DeclareMathOperator*\appliminf{app-liminf}\DeclareMathOperator*\applimsup{app-limsup}\DeclareMathOperator*\applim{app-lim}\DeclareMathOperator*\essliminf{ess liminf}\DeclareMathOperator*\esslimsup{ess limsup}$The answer is indeed yes. Further, the assumption that $f$ be differentiable a.e. is unnecessary. The main idea for this solution was suggested by Sam Forster on another website.
Define the function $g$ by
$$g(x) := \frac{1}{2} \bigl (\appliminf_{y \to x} f(y) + \applimsup_{y \to x} f(y) \bigr),$$
whenever the above two limits are finite, and $g(x) = f(x)$ otherwise, where here $\appliminf$ and $\applimsup$ denote the approximate limit supremum and limit infimum.
We note that $g$ has the following properties:

*

*$g(x) = \applim_{y \to x} f(y)$ wherever the limit exists. In particular the limit exists wherever $f$ is differentiable and equals $f(x)$.

*$g$ depends only on the equivalence class of $f$ modulo null sets.

Now I claim that this $g$ is maximally differentiable. To see this, let $h$ be another representative of $f$ and assume $h$ is differentiable at $x$. Then for every $\varepsilon > 0$, there exists $\delta > 0$, and $L \in \mathbb R$ such that
$$\left\lvert\frac{h(y) - h(x)}{y - x} - L\right\rvert \leq \varepsilon$$
whenever $\lvert y-x\rvert < \delta$.
I claim that the same holds for $g$, thus $g$ is differentiable as well at $x$. To see this, note that by (2) above, we may write
$$g(x) := \frac{1}{2} \bigl (\appliminf_{y \to x} h(y) + \applimsup_{y \to x} h(y)\bigr ).$$
Next, we note that for all $y$ with $\lvert y - x\rvert < \delta$,
$$\frac{\essliminf_{z \to y} h(z) - h(x)}{y - x} \leq \frac{g(y) - g(x)}{y - x} \leq \frac{\esslimsup_{z \to y} h(z) - h(x)}{y - x}$$
where we have applied (1) to write $g(x) = h(x)$. This implies
\begin{gather*}
\frac{(L - \varepsilon)(y-x)}{y - x} \leq \frac{g(y) - g(x)}{y - x} \leq \frac{(L + \varepsilon)(y -x)}{y - x} \\
L -\varepsilon \leq \frac{g(y) - g(x)}{y - x} \leq L + \varepsilon.
\end{gather*}
Since $\varepsilon$ was arbitrary, we conclude that $\lim_{y \to x} \frac{g(y) - g(x)}{y - x} = L$ and so $g$ is differentiable at $x$ as claimed.
