TITLE: function that doesn't belongs to $L_1$, but belongs to $L_p$ for $1<p\leq\infty$
QUESTION [2 upvotes]: Working on Bartle's book The Elements of Integration I found this exercise:
Take $(\mathbb{N},\mathcal{P}(\mathbb{N}),\mu)$, with $\mu$ as countable measure and define $f(n)=\dfrac{1}{n}$, prove that $f\notin L_1$ but $f\in L_p$ for $1<p\leq\infty$. Alternatively take $(\mathbb{R},\mathcal{B}(\mathbb{R}),\mu)$, with $\mu$ as lebesgue measure, and defining $g(x)=0$ for $x<1$ and $g(x)=\dfrac{1}{x}$ for $x\geq 1$.
I was able to solve the first part, it's only necessary to see that 
$\int \mid f\mid d\mu =\sum_{n\in\mathbb{N}}\mid f\mid(n)=\sum_{n\in\mathbb{N}}\dfrac{1}{\mid n\mid}=\sum_{n\in\mathbb{N}}\dfrac{1}{n}=\infty$, 
while $\int \mid f\mid ^{p} d\mu =\sum_{n\in\mathbb{N}}\mid f\mid ^{p}(n)=\sum_{n\in\mathbb{N}}\dfrac{1}{\mid n\mid ^{p}}<\infty$ when $1<p\leq\infty$
But for the second part do I have to prove true that $g\notin L_1$ but $g\in L_p$ for $1<p\leq \infty$?
I was able to prove that $g\in L_p$ for $1\leq p\leq \infty$ when $x<1$ but $g\notin L_p$ for $1\leq p\leq \infty$ when $x\geq 1$, just using the definition of $g$.
I'll appreciate any help, thanks.

REPLY [1 votes]: For the second one, you do not have any control on $x$. $g$ is defined on $\mathbb{R}$, by
$$
\forall x\in \mathbb{R},\quad g(x)=\begin{cases}
0 &\text{ if } x < 1 \\
\frac{1}{x} &\text{ if } x \geq 1 \\
\end{cases}
$$
What the problem asks you to show is that this (non-negative) function $g$ is in $L_p$ for all $p\in(1,\infty]$ but not in $L_1$, i.e. that for all fixed $1 < p \leq \infty$
$$
\int_\mathbb{R} \lvert g(x)\rvert^p \mu(dx) = \int_\mathbb{R} g(x)^p dx < \infty
$$
but
$$
\int_\mathbb{R} \lvert g(x)\rvert \mu(dx) = \int_\mathbb{R} g(x)dx = \infty.
$$

REPLY [1 votes]: In fact, for $p\in (1,\infty)$ $$\int_{\Bbb R}|g|^p(x)dx=\int_1^\infty \frac{dx}{x^p} = \frac {1}{p-1},$$
so $g\in L^p$ for $\infty>p>1$.
In addition, $\|g\|_{L^{\infty}}=1$, so $g\in L^\infty$, too.
However, $g\notin L^1(\Bbb R)$, because
$$\int_1^x |g|(s)ds = \int^x_1\frac{ds}{s} = \ln x\to\infty \text{ as }x\to\infty.$$
{"set_name": "stack_exchange", "score": 2, "question_id": 794426}