Determine the set $\{p\in\left[0, \infty\right] : f\in\mathcal L^p\left(\lambda\right)\}$ Consider the function $f: \mathbb R \rightarrow \mathbb R$ given by the following:
$$f\left(x\right)=\begin{cases}
        \frac{1}{x}, & \text{if } x\in \left(0, 1\right]\\
        0, & \text{if } x \in \mathbb R \backslash \left(0, 1\right]
        \end{cases}$$
Determine the following
$$\{p\in\left[0, \infty\right] : f\in\mathcal L^p\left(\lambda\right)\}$$
I guess that I have to show that $f\in \mathcal L^p\left(\lambda\right)$ and solve the integral $$\int_X|f|^p d\lambda$$ but I am not sure. I will appreciate it if I can get a little hint.
 A: The set is equal to $[0,1)$. Obviously for $p=0$ we have a finite integral. Now for $p\in(1,\infty)$:
Note that $$\int_\mathbb{R}|f|^p=\lim_{\varepsilon\to0^+}\int_\varepsilon^1\frac{1}{x^p}dx=\lim_{\varepsilon\to0^+}\frac{1}{1-p}[x^{1-p}]_{\varepsilon}^1=\lim_{\varepsilon\to0^+}\frac{1-\varepsilon^{1-p}}{1-p}=+\infty,$$
since $1-p<0$.
For $p=1$, $\int_\mathbb{R}|f|^p=\lim_{\varepsilon\to0^+}\int_\varepsilon^1\frac{1}{x}dx=\lim_{\varepsilon\to0^+}[\log(x)]_{\varepsilon}^1=\lim_{\varepsilon\to0^+}(\log(1)-\log(\varepsilon))=\infty$
For $p\in(0,1)$:
$$\int_\mathbb{R}|f|^p=\lim_{\varepsilon\to0^+}\int_\varepsilon^1\frac{1}{x^p}dx=\lim_{\varepsilon\to0^+}\frac{1}{1-p}[x^{1-p}]_{\varepsilon}^1=\lim_{\varepsilon\to0^+}\frac{1-\varepsilon^{1-p}}{1-p}=\frac{1}{1-p}<\infty$$
since $1-p>0$.
Finally, for $p=\infty$, note that the $\|\cdot\|_\infty$ norm is the essential supremum, i.e. $$\|f\|_\infty=\inf\{t>0: |f|\leq t\text{ almost everywhere}\}.$$
Remark: if $|f|\geq r$ in a set of positive measure, then $\|f\|_\infty\geq r$. (why?)
But given $n\in\mathbb{N}$ we have that, for $x\in(0,1/n)$, $f(x)=\frac{1}{x}>\frac{1}{\frac{1}{n}}=n$, so $f(x)>n$ for $x\in(0,1/n)$. Since the set $(0,1/n)$ has positive measure, we have that $\|f\|_\infty\ge n$. This is true for all $n\in\mathbb{N}$, and thus $\|f\|_\infty=\infty$.
