Show that if $X=(0,\infty)$ then the function $f(x) =\frac{1}{x^{1/2}\left(1+|\log x|\right)}$ is in $\mathcal L^2(\mu)$ but not in $\mathcal L^p(\mu)$ for any $p\in (1,2) \cup (2,\infty)$ where $\mu$ is the Lebesgue measure on $(0,\infty).$
I could solve the case for $p=2$ but for $p\neq 2,$ if we calculate the integral $\int_1^a f^p(x)\ \mathrm{d}x$, as $x >1,$ we can write $x=1+t,$ then we know $\log(1+t)<t$ and so $\int_1^a f^p(x) dx$ $>$ $\int_0^{a-1}$ $ \frac{\mathrm{d}t}{(1+t)^{3p/2}}$ but then I can't conclude anything from this .
A very small hint is very much required at this moment, thanks in advance.
To get you started, verify that $x^\alpha(1+|\log x|)^\beta\to 0$ as $x\to 0^+$ for any $\alpha,\beta >0.$ Thus if $p>2,$
$$\frac{1}{x^{p/2}(1+|\log x|)^p}= \frac{1}{x[x^{p/2-1}(1+|\log x|)^p]} > \frac{1}{x}$$
for small $x>0.$