Let $f: (0, \infty)\to \mathbb R$ be defined by $$f(x)=x^{-1/2}(1+|\ln x|)^{-1}.$$ Prove that $f\in L^2 (\mathbb R_{+}; m)\setminus L^p (\mathbb R_{+}; m)$ for all $p\in [1, \infty)\setminus \{2\}$.
My attempt so far:
For the case $p=2$, the function $f^2$ is non-negative. Since it is Riemann improper integrable, it is Lesbegue integrable and the two integrals agree. Thus, we have $$\int_{\mathbb R_{+}} f^2 dm = \int_0^{\infty} \frac{1}{x(1+|\ln(x)|)^2}~dx = 2.$$
If $p>2$, I got a hint to compare $$\int_0^1 x^{-1}(1-\ln x)^{-1}$$ to $$\int_0^1 |f(x)|^p~dx,$$ but I'm not sure why that is helpful. However, it should be the case, then, that I can make the comparison $$\int_a^{\infty} x^{-1}(1+\ln x)^{1-p}$$ to $$\int_a^{\infty} |f(x)|^p~dx$$ when $p<2$.
Note that if $x < 1$ you have that $|\ln(x)| = - \ln x$.
So when $x\in (0,1)$ you have $$ |f|^p = x^{-p/2} (1 - \ln x)^{-p} $$ when $p > 2$ you have $x^{-p/2} > x^{-1}$. So you get $$ |f|^p = x^{-1} x^{1-p/2} (1 - \ln x)^{-p} > C x^{-1}$$ provided you can show that $$ x^{1 - p/2} (1 - \ln x)^{-p} > C $$ when $x \in (0,1)$ and $p > 2$. Since the function on the left hand side is always positive in the interval and continuous, it suffices to show that the limit $$ \lim_{x \to 0} x^{1 - p/2} (1 - \ln x)^{-p} > 0 $$ This I leave as an exercise to the reader.
The case $x \to \infty$ for $p < 2$ is treated analogously.