Consider the function $u(x) = (1+x^2)^{-\frac{\alpha}{2}} (\ln(2+x^2))^{-1}$, where $0 < \alpha < 1$ and $x \in \mathbb{R}$.
Check that
- $u \in W^{1,p} (\mathbb{R})$ $\forall p \in [\frac{1}{\alpha},\infty)$
- $u \notin L^q (\mathbb{R})$ $\forall q \in [1,\frac{1}{\alpha}]$
First of all, I have a problem even with understanding why it is not in $L^1$. For that we need to see $\int\limits_{\mathbb{R}}|u(x)|d\mu > \infty$ (and for $L^q$ in general case $\int\limits_{\mathbb{R}}|u(x)|^q d\mu > \infty$). But since $x$ is real it has no singular points and $u(x) \to 0$ when $x \to \infty$, so I can't see why it is not Lebesgue integrable.
Things to keep in mind: $$\int_2^\infty \frac{1}{x^\beta} \,dx \quad \text{converges } \iff \beta>1 \tag1$$ $$\int_2^\infty \frac{1}{x\log^\beta x} \,dx \quad \text{converges } \iff \beta>1 \tag2$$ Both are verified by direct integration.
The function $u^q$ is asymptotic to $\dfrac{1}{x^{\alpha q}\log^q x}$. This is not integrable when $q<1/\alpha$, by (1). However, it is integrable for $q=1/\alpha$, by (2) — so that particular claim is false. To summarize: $u\in L^q$ iff $q\ge 1/\alpha$.
As for Sobolev classes, the smoothness of $u$ implies that we have the weak derivative represented by $u'$, so the question is whether $u, u'\in L^p$. The function $u$ was already considered above. As for $u'$, it is asymptotic to $x^{-\alpha-1}\log^{-1}x$ at infinity (consider the size of the different terms that the product rule produces), so its integrability is even better than that of $u'$.