Find all values of $p$, with $1\leq p \leq \infty $, for which $f\in L^p(X,\mu)$. I am struggling on this qualifying exam question that I found. A hint is provided that says Fubini may be helpful here, but I can't see how to setup the problem to apply it. Here is the question:
Let $(X,\mathcal{M},\mu) $ be a finite measure space. Let $f:X\rightarrow \mathbb{R} $ be measurable. Suppose that there is a $R>0$  such that for all $r>R$:
$$ \mu(\{x\in X:|f(x)|>r\}) = \frac{1}{r^2}$$
Find all values of $p$, with $1\leq p \leq \infty $, for which $f\in L^p(X,\mu)$.
So far I have made the following, albeit trivial, progress:
First I recognize that since $(X,\mathcal{M},\mu) $ is a finite measure space that if $1\leq p <q \leq \infty$ then $ L^q(X,\mathcal{M},\mu) \subset L^p(X,\mathcal{M},\mu)$, so my goal is to see find the largest $p$ such that $f\in L^p(X,\mathcal{M},\mu) $.
Let $Y_r=\{x\in X :|f(x)|>r \} $, then
$$\int_X |f(x)| d\mu(x)=\int_{X\setminus Y_r}|f(x)|d\mu(x) + \int_{Y_r} |f(x)| d\mu(x) $$
where the first integral on the RHS is finite since it is at most $r\cdot\mu(X)<\infty $ and perhaps I can show that the latter integral on the RHS is finite for some fixed $r\in \mathbb{R}$, but I suspect I am on the wrong path.
How would one go about solving this question using Fubini's Theorem?
 A: This problem is related to the well-known technique called the cake-layer integration. For notational simplicity, we introduce the indicator function notation:
$$ \mathbf{1}_{\{\dots\}} = \begin{cases} 1, & \text{if $\dots$ is true;} \\ 0, & \text{if $\dots$ is false.} \end{cases} $$
Then by the Fubini–Tonelli theorem,
\begin{align*}
\int_{X} |f(x)|^p \, \mu(\mathrm{d}x)
&= \int_{X} \int_{0}^{|f(x)|} pr^{p-1} \, \mathrm{d}r \mu(\mathrm{d}x) \\
&= \int_{X} \int_{0}^{\infty} pr^{p-1}\mathbf{1}_{\{r<|f(x)|\}} \, \mathrm{d}r \mu(\mathrm{d}x) \\
&= \int_{0}^{\infty} \int_{X} pr^{p-1}\mathbf{1}_{\{r<|f(x)|\}} \,  \mu(\mathrm{d}x)\mathrm{d}r \tag{$\because$ Tonelli} \\
&= \int_{0}^{\infty} pr^{p-1}\mu(\{x\in X : |f(x)| > r\}) \, \mathrm{d}r.
\end{align*}
In your case, $\mu(\{x\in X : |f(x)| > r\}) = r^{-2}$ and so,
$$ \int_{X} |f(x)|^p \, \mu(\mathrm{d}x) = \int_{R}^{\infty} pr^{p-3} \, \mathrm{d}r + C, $$
where $C = \int_{0}^{R} pr^{p-1}\mu(\{x\in X : |f(x)| > r\}) \, \mathrm{d}r$ is bounded by $R^p \mu(X)$ and hence finite. Using this, you should be able to determine the values of $p$ for which $f \in L^p$.
