Intuition about weakly differentiable functions I've seen the answers to this question, which are pretty good, but I'd like to have a bit better of an idea about what it means to be weakly differentiable. I have two questions in particular.


*

*The top answer states that "a weakly differentiable function looks differentiable except for on sets of zero measure". Does that mean that if $f$ is weakly differentiable on $\Omega$, there exists a set $E \subset \Omega$ of zero measure such that $f \left|_{\Omega\backslash E} \right.$ is differentiable?

*An example (still in the top answer to the linked question) shows that "well-behaved" functions with jump discontinuities are not weakly differentiable. Does that mean that any weakly differentiable function $f$ has a representative (i.e. a function differing only on a set of measure zero) that is continuous?
 A: The way I see it, weak differentiability is a special case of distributional differentiability.
The weak derivative is defined exactly the same way as the distributional derivative, with an additional regularity requirement.
Every distribution has a distributional derivative, and most functions you will encounter are distributions.
For example, any locally $L^1$ function is a distribution.
Taking derivatives typically makes regularity worse, so the distributional derivative of a function is not always a function — but it will always be a distribution.
A function $f$ is said to be in the Sobolev space $W^{1,p}$ if $f\in L^p$ and the first order weak derivatives of $f$ are also in $L^p$.
Therefore weak differentiability is determined by how nice the distributional derivative is.
(Weak differentiability depends on the chosen space. The typical assumption is that the distributional derivative has to be locally $L^1$, but there are other possible choices.)
Here is an example of how bad weakly differentiable functions can be.
Consider the unit ball $B$ in $\mathbb R^n$, $n\geq3$.
For any $y\in B$, the function $f_y(x)=|x-y|^{2-n}$ is in $W^{1,1}(B)$.
Now take a dense sequence of points $(y_i)$ in $B$.
Since $W^{1,1}(B)$ is a Banach space and one can find a uniform bound on the norm of $f_y$ in $W^{1,1}(B)$, the series
$$
f
=
\sum_{i=0}^\infty 2^{-i}f_{y_i}
$$
converges and defines a function $f\in W^{1,1}(B)$.
This function $f$ is weakly differentiable, but it is not bounded in any open set $U\subset B$.
Changing $f$ on a set of measure zero will not change this behaviour, so $f$ does not have a continuous representative.
In fact, all representatives are discontinuous at every point (and thus nowhere differentiable), but the function is still weakly differentiable.
For any $y\in B$ the function $f_y$ is essentially unbounded: redefining it on a null set will not make it bounded.
This is because the set where $f_u>a$ has positive measure for any $a>0$.
All the functions $f_{y_i}$ are positive, so $f$ blows up at least as badly as $2^{-i}f_{y_i}$ for all $i$.
Therefore the sum function $f$ is essentially unbounded everywhere: for any non-empty open set $U\subset B$ and a null set $E\subset B$ the function $f|_{U\setminus E}$ is unbounded.
Therefore it cannot be differentiable either.
To answer your two questions explicitly using the example function $f$ constructed above:


*

*No, the function is not differentiable on the complement of any null set.

*No, there is no continuous representative.
