I want to find two examples $f\in L^p([0,1]) \backslash L^q([0,1]) $ and $g\in L^p(\mathbb{R}) \backslash L^q(\mathbb{R}) $ given $1\leq p < q < \infty$.
It turns out the two examples I found are the same to some extent.
Set $f(x)=\frac{1}{x^b}.1_{(0,1)}$ with $b\in (1/q,1/p)$. We will show that $f\in L^p([0,1])$ but $f\notin L^q([0,1])$. Indeed, we have $1-pb\in (0,1-p/q)$, hence $$ \int_\mathbb{[0,1]} f(x)dx=\frac{x^{1-pb}}{1-pb}|^1_0<\infty. $$ But $1-qb\in (1-q/p,0)$, hence $$ \int_\mathbb{[0,1]} f(x)dx=\frac{x^{1-qb}}{1-qb}|^1_0=\infty. $$
Miraculously, this works for $\mathbb{R}$ as well
We will show that $f\in L^p(\mathbb{R})$ but $f\notin L^q(\mathbb{R})$. Indeed, we have $1-pb\in (0,1-p/q)$, hence $$ \int_\mathbb{R} f(x)dx=\frac{x^{1-pb}}{1-pb}|^1_0<\infty. $$ But $1-qb\in (1-q/p,0)$, hence $$ \int_\mathbb{R} f(x)dx=\frac{x^{1-qb}}{1-qb}|^1_0=\infty. $$
Am I wrong somewhere? Thanks