I want to know what the "highest" regularity is for a piecewise constant function. For example: $$ f(x)=\left\{\begin{align*} &1, & x\in [0,1),\\ &0, & x\in (-1,0).\end{align*}\right. $$ We know that $f\in L^p(\Omega)$ where $\Omega=(-1,1)$ and $p\geq 1$, but $f\not\in W^{1,p}(\Omega)$ ($W^{k,p}$ denotes the Sobolev space whose functions and their $k$-th derivatives are both in $L^p$ space) since $f(0^+)\not=f(0^-)$.
Now, I am wondering may the function $f(x)$ has any higher regularities? such as $f\in W^{\varepsilon,p}(\Omega)$ with $0 < \varepsilon < \frac12$ (or $0<\varepsilon <1$)? If this is right, how to prove it?
It turns out that dealing with your definition of fractional Sobolev spaces in not too bad.
We show: Let $1\leq p\leq\infty$ and $0<s<1$, then $f\in W^{s,p}(-1,1)$ if and only if $0<s<1/p$.
We only treat the case $p<\infty$, the other is simply noting that $f$ is not Hölder continuous of any order.
First notice that $|f(x)-f(y)|=1$ whenever $x\in (0,1)$ and $y\in (-1,0)$ or vice versa, and $|f(x)-f(y)|=0$ otherwise. So that means, by symmetry, $$ \int_{-1}^1\int_{-1}^1 \dfrac{|f(x)-f(y)|^p}{|x-y|^{1+sp}}\, dx dy = 2 \int_{-1}^0\int_0^1\dfrac{dxdy}{|x-y|^{1+sp}} = 2\int_0^1\int_0^1 \dfrac{dxdy}{(x+y)^{1+sp}}. $$
Now do a change of variables $z=x+y$ in the inner integral to write $$ \int_0^1\int_0^1\dfrac{dxdy}{(x+y)^{1+sp}}= \int_0^1 \dfrac{1}{sp}\left( y^{-sp}- (y+1)^{-sp}\right)\, dy. $$
The second term has no singularity for any $s, p$, while the first one is integrable if and only if $sp<1$, which gives the result.