Hardy's Inequality: Problems $3.14$ and $3.15$ in Rudin's RCA In Problem $3.14$, we prove (a) Hardy's inequality, (b) the condition for equality, and I shall talk about (c), (d) below. Problem $3.15$ is the discrete case of Hardy's inequality. I have asked three related questions in a single post itself, since all of them are related to Hardy's inequality, and none should be too involved.
There are some existing posts on MSE related to these topics, so I shall link them right away and point out that my question is not a duplicate: Post 1, Post 2, Post 3, Post 4.

For the sake of mentioning it, Hardy's inequality is: For $p\in (1,\infty)$, $f\in L^p((0,\infty))$ relative to the Lebesgue measure, and $$F(x) = \frac{1}{x}\int_0^x f(t)\ dt\quad (0 < x < \infty)$$ we have $$\|F\|_p \le \frac{p}{p-1} \|f\|_p$$

Question 1: This is Problem $3.14(c)$ in Rudin's book.

Prove that the constant $p/(p-1)$ cannot be replaced by a smaller one.

In one of the linked posts, there is some discussion on how this is the best constant, but I was unable to follow it. My sense is that it suffices to find a counterexample, i.e. for every constant $\beta$ smaller than $p/(p-1)$, we need a function $f_\beta\in L^p((0,\infty))$ which does not satisfy the required inequality. Why are we complicating things? If I'm thinking right, could someone help me find a counterexample?
Question 2: This appears as Problem $3.14(d)$ of Rudin's book. The author is trying to emphasize that the inequality is not for $p = 1$.

If $f > 0$ and $f\in L^1$, prove that $F\notin L^1$.

I found an example, $f(x) = e^{-x}$. Then $F(x) = \frac{1-e^{-x}}{x}$. $F$'s integral diverges, since the integral of $1/x$ diverges (use limit comparison test for integrals). However, as @David C. Ullrich pointed out, this is not enough.
Question 3: This is Problem $3.15$ in the same book and is the discrete case of Hardy's inequality.

Suppose $\{a_n\}$ is a sequence of positive numbers. Prove that $$\sum_{N=1}^\infty \left(\frac{1}{N} \sum_{n=1}^N a_n \right)^p \le \left(\frac{p}{p-1} \right)^p \sum_{n=1}^\infty a_n^p$$ if $1 < p < \infty$. If $a_n\ge a_{n+1}$, the result can be made to follow from Hardy's inequality. This special case implies the general one.

I took $f = \sum_{n=1}^\infty a_n \mathbf{1}_{[n,n+1]}$. Then $f\in L^p$ only if $\sum_{n=1}^\infty a^p_n < \infty$. If $f\notin L^p$, the inequality is trivial. So let's take $f\in L^p$. Now using Hardy's inequality, we have $\|F\|_p \le \frac{p}{p-1} \|f\|_p$. What is $F$? $$F(x) = \frac{1}{x}\int_0^x \sum_{n=1}^\infty a_n\mathbf{1}_{[n,n+1]}(t)\ dt = \frac{1}{x}\left(\sum_{n=1}^{\lfloor x\rfloor} a_n + (x - \lfloor x\rfloor)a_{\lfloor x\rfloor + 1} \right)$$
How do I proceed?

P.S. I have already solved Problems $3.14(a)$ and $3.14(b)$, i.e. proving Hardy's inequality and showing that equality holds iff $f = 0$ a.e.
 A: May details are left to you. The important part is that you review Post 4 where they show why $p/(p-1)$ is the best contact in Hardy's inequality. I give a brief explanation (but do not re do any of the constructions there) of why this is the case.

Question 1: The answers to the Post 4 (one of which follow the Hint of your textbook) gives the optimal bound in Hardy's inequality. To see this, notice that each solution there explicitly constructs a sequence of functions  $\{f_n:n\in\mathbb{N}\}\subset L_p$, such that

*

*$\|f_n\|_p=1$,

*and $\lim_n\|Hf_n\|_p=\frac{p}{p-1}$.

If the bound $p/(p-1)$ were not optimal, and say $\|Hf\|_p\leq c\|f\|_p$ for all $f\in L_p$, for some constant  $c<\frac{p}{p-1}$, then for any of the sequences built in the aforementioned posting, you would have  that
$$c\|f_n\|=c\geq \|Hf_n\|_p\xrightarrow{n\rightarrow\infty}\frac{p}{p-1}$$
which is a contradiction to $c<p/(p-1)$.

Question 3: suppose $\{a_n:n\in\mathbb{N}\}$ is a monotone non increasing sequence of positive numbers  such that $\sum_na^p_n<\infty$, and define $f$ as
$$
f(x):=\sum^\infty_{n=1}a_n\mathbb{1}_{(n-1,n]}(x)$$
and consider the Hardy transform $Hf$ of  $f$, i.e., $Hf(x):=\frac1x\int^x_0f(t)\,dt$
Then
$$Hf(x)=\left\{ \begin{matrix}
a_1 &\text{if}&0<x\leq1\\
\tfrac{a_1+\ldots + a_n+(x-n)a_{n+1}}{x} & \text{if} &1\leq n<x\leq n+1
\end{matrix}
\right.
$$
The assumption on $a_n$ implies that for $1\leq n<x\leq n+1$
$$\begin{align}
\frac{a_1+\ldots + a_n+(x-n)a_{n+1}}{x}&=\frac{(a_1-a_{n+1})+\ldots +(a_n-a_{n+1})}{x}+a_{n+1}\\
&\geq \frac{a_1+\ldots+ a_n-na_{n+1}}{n+1} +a_{n+1}=\frac{a_1+\ldots + a_{n+1}}{n+1}
\end{align}$$
Hence
$$\begin{align}
\int^\infty_0(Hf)^p&=\sum^\infty_{n=0}\int^{n+1}_n(Hf)^p\\
&\geq\sum^\infty_{n=0}\Big(\frac1{n+1}\sum^{n+1}_{k=1}a_k\Big)^p
=\sum^\infty_{n=1}\Big(\frac1{n}\sum^{n}_{k=1}a_k\Big)^p
\end{align}$$
Provided you have proved Hardy's inequality for $L_p((0,\infty),\mathscr{B}((0,\infty),\lambda)$, where $\lambda$ is Lebesgue's measure,  then
The conclusion of Question 2 follows for the special case $0\leq a_{n+1}\leq a_n$ for all $n\in\mathbb{N}$.
See if you can get the general case ($a_n\geq0$ and $\sum^\infty_{n=1}a^p_n<\infty$) from this (consider for example finite segments of $a_n$, that is $b^{(m)}_n=a_n\mathbb{1}_{(0,m]}(n)$ and apply the result to a "reordering" of $b^{(m)}$).

Question 2: As David C. Ulrich mentioned in his comment and answer, the problem asks to show that $Hf\notin L_1(0,\infty)$ for all $f\in L_1(0,\infty)$ with $f>0$. Here is a proof using Fubini's theorem. Since $g(t, x)=\frac{1}{x}f(t)\mathbb{1}_{(0,x]}(t)\geq0\,$ and  measurable in $(0,\infty)\times(0,\infty)$,  one can iterate integrals to get
\begin{align}
\int^\infty_0\int^x_0\frac{1}{x}f(t)\,dt\,dx&=\int^\infty_0\int^\infty_t\frac{1}{x}f(t)\,dx\,dt=\int^\infty_0f(t)\int^\infty_t\frac{1}{x}\,dx\,dt=\infty
\end{align}
A simpler proof is given by David C. Ulrich here
A: People seem to be misinterpreting Q2. It says


If $f > 0$ and $f\in L^1$, prove that $F\notin L^1$.


You can't do that by giving an example. Luckily it's
trivial:
Since $f>0$ some elementary measure theory(see below) shows that there exists a bounded set $E$ with $m(E)>0$ and a $\delta>0$ so $f\ge\delta$ on $E$. Hence if $x>\sup E$ we have $$F(x)=\frac1x\int_0^x f
\ge\frac1x\int_E\delta=\frac{\delta m(E)}{x},$$so $F\notin L^1$.
Below
(edit) If $f(x)>0$ there exists $n\in\Bbb N$ with $f(x)>1/n$; hence $$(0,\infty)=\bigcup_{n=1}^\infty I_n,$$ where $$I_n=\{x:f(x)>1/n\}.$$So countable additivity shows there exists $n_0$ with $$m(I_{n_0})>0.$$
Again, $$I_{n_0}=\bigcup_{k=1}^\infty(I_{n_0}\cap(0,k)),$$so we can let $E=I_{n_0}\cap(0,k)$ for a suitable $k$; any choice of $k$ gives a bounded set on which $f>\delta>0$, and if $k$ is large enough then $m(E)>0$.
