Is a weakly differentiable function differentiable almost everywhere? I am working with Sobolev spaces. Let's suppose $\Omega \subset \mathbb{R}^n$ is an open set.
A function $u: \mathbb{R}^n \to \mathbb{R}$ in $L^1(\Omega)$ is said to be weakly differentiable if there exist functions $ g_1,...,g_n $  such  that  $$\qquad\qquad\qquad\qquad\qquad\int_{\Omega}u\varphi_{x_i}=-\int_{\Omega}g_i \varphi \quad \quad   \forall \varphi \in C^{1}_c(\Omega), \forall i=1,...,n. $$
Can every weakly differentiable function be restricted to an open set $\tilde{\Omega}$ such that $u$ is differentiable (classical derivative!) with $m(\Omega - \tilde{\Omega})=0$?
I know this is true for dimension $1$. Is it true for every $\Omega \subset \mathbb{R}^n$?
 A: This is not true for dimension $n>1$. In the book "Some Applications of Functional Analysis in Mathematical Physics" by Sobolev the following example is constructed. Consider function $\varphi(x,y)=f_1(x)+f_2(y)$, where $f_1$ and $f_2$ are continuous on $\mathbb{R}$ nowhere differentiable functions. Then $\varphi$ doesn't have strong (classical) derivatives, but weak derivative $\frac{\partial^2\varphi}{\partial x\partial y}$ exists and equals $0$ on every $\Omega=(a,b)\times(c,d)$. Indeed,
$$
\int\limits_\Omega\varphi\frac{\partial^2\psi}{\partial x\partial y}d\mu
=
\int\limits_\Omega f_1(x)\frac{\partial^2\psi}{\partial x\partial y}d\mu
+
\int\limits_\Omega f_2(y)\frac{\partial^2\psi}{\partial x\partial y}d\mu.
$$
But $\frac{\partial\psi}{\partial x}=\frac{\partial\psi}{\partial y}=0$ on the border $\overline{\Omega}\setminus\Omega$ of $\Omega$, so
$$
\int\limits_{\Omega}f_1(x)\frac{\partial^2\psi}{\partial x\partial y}d\mu
=
\int\limits_a^bf_1(x)\int\limits_c^d \frac{\partial^2\psi}{\partial x\partial y}dy\, dx
=
\int\limits_a^bf_1(x) \frac{\partial\psi}{\partial x}\Bigg|_{y=c}^{y=d} dx =0
$$
and the same way we get
$$
\int\limits_{\Omega}f_2(y)\frac{\partial^2\psi}{\partial x\partial y}d\mu = 0.
$$
Therefore
$$
\int\limits_{\Omega}\varphi\frac{\partial^2\psi}{\partial x\partial y}d\mu = 0.
$$
A: Yes, there is a generalization. You can find details in the textbook by Ziemer, "Weakly differentiable functions".
I don't have the textbook at hand so I am only paraphrasing here. Any function $f : \mathbb R^n \rightarrow \mathbb R$ is a member of $W^{1,p}$ if it is absolutely continuous on almost all line segments parallel to the coordinate axes and its partial derivatives $\partial_1 f, \dots, \partial_n f$ exist almost everywhere and are $p$-integrable.
