discontinuous functions on the Sobolev borderline The Sobolev embedding theorem implies that every function of class $W^{k,p}$ on a reasonable $n$-dimensional domain is continuous if $kp > n$.  Cases with $kp=n$ are known as "borderline" cases.  In my question I'm going to focus on the case $p=2$ for functions on either ${\mathbb R}^n$ or ${\mathbb T}^n$, so that the Sobolev spaces $H^k = W^{k,2}$ have a nice description in terms of Fourier transforms or series, but answers concerning more general Sobolev spaces are also welcome.
It seems to be tricky to find concrete examples of discontinuous functions that are Sobolev borderline cases.  Some searching turned up an example in $H^1({\mathbb R}^2)$, but I have been unable to find a "simple" example in what I intuitively expect to be the easiest case, namely $H^{1/2}(S^1)$, and I was surprised that none of the textbooks I could think to search in give one.  My first impulse was to try classic discontinuous functions like the square wave and sawtooth whose Fourier series are easy to compute: these just miss the mark, as they turn out to be in $H^s(S^1)$ for all $s < 1/2$ but not for $s=1/2$.  The one thing I have tried that worked was writing down an explicit Fourier series like
$$
f(x) := \sum_{k=2}^\infty \frac{e^{2\pi i k x}}{k \ln k},
\qquad \text{ (here $x \in S^1 := {\mathbb R} / {\mathbb Z}$)}
$$
which one can easily check is in $H^{1/2}(S^1)$, and one can then use summation by parts to estimate $\sum_{k=N}^\infty \frac{e^{2\pi i kx}}{k \ln k}$ for large $N$ and small $|x|$ and thus prove $\lim_{x \to 0} f(x) = \infty$.  One can do something similar with a Fourier transform and integration by parts to find a function in $H^{1/2}({\mathbb R})$ that is continuous everywhere except at $x=0$, where it blows up.  But this type of construction is a lot trickier than what I was hoping for; expressing a function as a conditionally convergent series or improper integral does not give me the feeling that I can get my hands on it.
So, first question: does anyone know a simpler example of something that is discontinuous and belongs to $H^{1/2}(S^1)$ or $H^{1/2}({\mathbb R})$?  Or other interesting examples of Sobolev borderline functions that can be understood without having to search the exercises in Baby Rudin for hints?
Followup question, admittedly a little vague: if you don't know more concrete examples, is there any deep reason why they don't exist, i.e. why every function I can think to write down in a reasonable way turns out to fall short of the borderline case?
 A: There are plenty of examples of discontinuous Sobolev function in $W^{1,n}(\mathbb{R}^n)$. For example $f(x)=\log|\log|x||$ defined in a neighborhood of zero.
Now take $n=2$ and restrict the function to the $x$-axis. You will get a discontinuous function in the trace space which is $H^{1/2}(\mathbb{R})$.
You can use this function to construct quite strange examples.
Taking $x\mapsto f(x-a)$ you can place singularity at any point $a$.
Modifying this example you can assume that $\Vert f\Vert_{1,n}<\epsilon$
and that the function has support in a small neighborhood of $a$.
If $\{a_i\}_i$ is a countable and dense subset of $\mathbb{R}^n$,
and $f_i$ is a function with the singularity as above at the point $a_i$ and $\Vert f_i\Vert_{1,n}<2^{-i}$, then the series
$$
f=\sum_{i=1}^\infty f_i
$$
converges to a function in $W^{1,n}$, because it is a Cauchy series in the norm and $W^{1,n}$ is a Banach space. The function $f$ will have singularities located on a dense subset of $\mathbb{R}^n$ and in particular the essential supremum of $f$ over any open set will be equal $+\infty$.
You can also take $\{a_i\}_i$ to be a dense subset in a subspace $\mathbb{R}^{n-1}$ of $\mathbb{R}^n$ and a similar construction will give you a function that is bad when restricted to that subspace. The trace belongs to $W^{1-1/n,n}(\mathbb{R}^{n-1})$. In particular if $n=1$ you get such a function in $W^{1/2,2}(\mathbb{R})=H^{1/2}(\mathbb{R})$.
