Construct $f$ such that $f\in L^{p_0}$ but $f\notin L_p$ for $p\ne p_0$ 
Let $1\leq p_0\leq\infty$. Construct a function $f\in L^{p_0}(\mathbb{R}^n)$ such that for all $p\ne p_0$, $f\notin L_p(\mathbb{R}^n)$.

This is an exercise from Jones' Lebesgue Integration on Euclidean Space, page 244. I think this can be solved using only elementary methods, such as appropriate combinations of reciprocals and logarithms.. but I am stuck at the moment. Can someone give me a hint for the construction? Any advice is welcome.
 A: Let $a>n$ and
$$
g_a(x)=\left\{\begin{array}{ccc}|x|^{-a} & \text{if} & |x|\ge 1, \\ 0 & \text{if} & |x|< 1\end{array}\right.
$$
Then $\int_{\mathbb R^n}g_a(x)\,dx=\omega_{n-1}\int_1^\infty r^{-a}r^{n-1}\,dr=\frac{\omega_{n-1}}{a-n}$, where $\omega_{n-1}$ is the $(n-1)-$dimensional area of the unit sphere in $\mathbb R^n$.
Let $b>-n$
$$
h_b(x)=\left\{\begin{array}{ccc}|x|^{b} & \text{if} & |x|\le 1, \\ 0 & \text{if} & |x|> 1\end{array}\right.
$$
Then $\int_{\mathbb R^n}h_b(x)\,dx=\omega_{n-1}\int_0^1 r^{b}r^{n-1}\,dr=\frac{\omega_{n-1}}{b+n}$.
Given now a $p_0\in (1,\infty)$, the function $f=g_a+h_b$ lies in $L^{p_0}$ iff
$$
ap_0-n>0\quad\text{and}\quad bp_0+n>0
$$
or
$$
a>\frac{n}{p_0}\quad\text{and}\quad b>-\frac{n}{p_0}
$$
Set
$$
a_k=\frac{n}{p_0}+2^{-k}, \quad b_k=-\frac{n}{p_0}+2^{-k},
$$
and let
$$
f=\sum_{k=1}^\infty w_k (g_{a_k}+h_{b_k}),
$$
where $w_k$ are positive weights allowing $f\in L^{p_0}$.
Clearly $f\not\in L^{p}$, for $p>p_0$, due to the $a_k$'s and
$f\not\in L^{p}$, for $p<p_0$, due to the $b_k$'s.
The cases $p_0=1$ and $p_0=\infty$ are much easier to deal with.
