How can one prove (or where can I find a proof) that if $u \in W^{1,p}(\Omega)$, where $\Omega \subset \mathbb{R}^N$, then $u$ cannot have a $(N1)$manifold of discontinuity points?

1$\begingroup$ $u\in W^{1,p}$, $p\leq N$ can be discontinuous everywhere. Behavior on $(n1)$ submanifold is a different story. $\endgroup$ – Piotr Hajlasz Apr 5 at 23:48

$\begingroup$ @PiotrHajlasz Indeed. Could you point out a reference where the result is phrased accurately (and proved)? $\endgroup$ – Riku Apr 6 at 0:49

$\begingroup$ I will write an answer soon. $\endgroup$ – Piotr Hajlasz Apr 10 at 16:03
Any function in $W^{1,p}$, $p>N$, has a continuous representative by the Sobolev embedding theorem so there is no issue here. However:
Proposition. There is a function $f\in W^{1,p}$, $p\leq N$, that is essentially discontinuous everywhere. In fact you can find a function such that the essential supremum on every open set is $+\infty$ and the essential infimum on every open set is $\infty$.
See Example 2.26 in [2]. For a similar construction see also:
A function in $W^{1,p}(\Omega)$ for $1 < p < n$ which is not differentiable a.e.
Thus the answer to the question the way it is stated is no, the function can be essentially discontinuous everywhere.
There is however, a different point of view which shows that, in fact, a Sobolev function behaves nicely when restricted to an $(N1)$dimensional manifold and I will present two different approaches to it.
Approach 1. According to Theorem 2 p. 164 in [1] (I am referring to the first edition) any function $f\in W^{1,p}$ has a representative that is absolutely continuous on almost all lines. Here by a representative I mean a Borel function defined everywhere and equal to $f$ almost everywhere.
If $M\subset\Omega$ is an $(N1)$dimensional manifold, then almost all lines pass through almost all points on $M$ so we can define restriction of $f$ to $M$ by looking at values of $f$ at the points where the lines intersect with $M$. Such a restriction is called a trace. Therefore $f$ may be discontinuous on $M$, but still it behaves nicely on $M$.
Approach 2. Any Function in $W^{1,p}$, $p>N$, has a continuous representative by the Sobolev embedding theorem so there is no issue here.If $f\in W^{1,N}$, then $f\in W^{1,p}_{\rm loc}$ for ant $1\leq p<N$ so it suffices to discuss the case $1\leq p<N$ only.
The following result is Theorem 1 on p. 160 in [1].
Theorem 1. There is a representative of $f\in W^{1,p}(\Omega)$, $1\leq p<N$, $\Omega\subset\mathbb{R}^N$ that is $p$quasicontinuous. That means for any $\epsilon>0$, there is an open set $V\subset\Omega$ with $\operatorname{Cap}_p(V)<\epsilon$ such that $f_{\Omega\setminus V}$ is continuous.
Here $\operatorname{Cap}_p$ stands for the $p$capacity.
Capacity is a certain outer measure. While I will not recall its definition I will explain how it is related to the Hausdorff measure. The next result is Theorem 4 p. 156 and and Theorem 3 p. 193 in [1].
Theorem 2. If $1\leq p<N$ and $\operatorname{Cap}_p(A)=0$, then $\mathcal{H}^s(A)=0$ for all $s>np$. Moreover if $A$ is compact, then $\operatorname{Cap}_1(A)=0$ if and only if $\mathcal{H}^{N1}(A)=0$.
Now Theorem 1 says that away of a set of arbitrarily small capacity, $f$ is continuous so the exceptional set has capacity zero and Theorem 2 says that this exceptional set has vanishing $(N1)$dimensional measure. Therefore is we consider an $(N1)$dimensional manifold $M$ in $\Omega$ this exceptional set has measure zero.
[1] L. C. Evans, R. F. Gariepy, Measure theory and fine properties of functions. Studies in Advanced Mathematics. CRC Press, Boca Raton, FL, 1992.
[2] P. Hajłasz, Nonlinear elliptic partial differential equations .

$\begingroup$ Approach 1 is very nice to have an insight. But can it be turned into a rigorous proof? I don't quite see how to do this because e.g. $f(x,y) = \chi_{\mathbb Q}(x)$ is discontinuous everywhere, but continuous along all vertical lines. $\endgroup$ – Skeeve Apr 11 at 8:24

$\begingroup$ @Skeeve First of all I do not claim that $f$ restricted to $M$ is continuous only that it is well defined a.e. on $M$. Secondly $\chi_{\mathbb{Q}}$ is in fact continuous since it equals zero a.e. so you can find a continuous representative of $\chi_{\mathbb{Q}}$ in the class of functions equal a.e. $\endgroup$ – Piotr Hajlasz Apr 11 at 14:16

$\begingroup$ sure, I agree that $\chi_{\mathbb Q}$ is a bad representative of $0$. But my comment was just to show that even if some function $g$ is continuous along lines then I don't see how to conclude that $g$ cannot be discontinuous on $M$. I mean, how do you proceed after constructing good representative $g$? $\endgroup$ – Skeeve Apr 11 at 14:30

$\begingroup$ @Skeeve As I said, $f$ restricted to $M$ may be discontinuous, because traces are not necessarily continuous. Traces will be continuous on almost all $(N1)$dimensional manifolds if $p>N1$. $\endgroup$ – Piotr Hajlasz Apr 11 at 14:32

$\begingroup$ Excuse me, but the sentence
This is how you need to understand that M cannot be the set of discontinuity of f
still confuses me. I will try to understand it better, but if you add some details it would be helpful. $\endgroup$ – Skeeve Apr 11 at 14:42