Consider a probability space $([0,1],\mathcal{B}([0,1],\lambda),p>1$ and $f \in L^p(]0,\infty[).$
We want to prove Hardy's inequality using martingale theory and Doob's maximal inequalities. Let $\mathcal{F}_n$ be the $\sigma$-algebra generated by $]k2^{-n},(k+1)2^{-n}],k=0,...,2^n-1.$
I managed to find, for an integrable function $h,$ $E[h|\mathcal{F}_n](x): E[h|\mathcal{F}_n]=2^n\sum_{k=0}^{2^n-1}\int_{k2^{-n}}^{(k+1)2^{-n}}h(y)dy1_{]k2^{-n},(k+1)2^{-n}]}(x),x \in [0,1].$
How to use this and Doob's maximal inequalities to prove that: $$\left(\int_{0}^\infty\left|\frac{1}{x}\int_{0}^xf(y)dy\right|^pdx\right)^{1/p} \leq \frac{p}{p-1}\left(\int_0^{\infty}|f(x)|^pdx\right)^{1/p}$$