Solution (source code)

= Solution

The relation $1/q=1/p-\alpha/n>0$ implies $\alpha p<n$. Fix $r>0$ and split the <Riesz potential> into the regions $|x-y|<r$ and $|x-y|\geq r$.

For the near part, decompose the ball into the dyadic annuli
$$
2^{-k-1}r\leq|x-y|<2^{-k}r,
\qquad k\geq0.
$$
The definition of the <Hardy-Littlewood maximal function> then gives
$$
\int_{|x-y|<r}\frac{|f(y)|}{|x-y|^{n-\alpha}}\,dy
\leq C_{n,\alpha}r^\alpha Mf(x)
\sum_{k=0}^\infty2^{-k\alpha}
\leq C r^\alpha Mf(x).
$$
For the far part, <Hölder's inequality> gives
$$
\begin{aligned}
\int_{|x-y|\geq r}\frac{|f(y)|}{|x-y|^{n-\alpha}}\,dy
&\leq\lVert f\rVert_p
\left(\int_{|z|\geq r}|z|^{-(n-\alpha)p'}\,dz\right)^{1/p'}\\
&\leq C\lVert f\rVert_p r^{\alpha-n/p},
\end{aligned}
$$
where convergence follows from $\alpha p<n$.

If $Mf(x)>0$, choose
$$
r^{n/p}=\frac{\lVert f\rVert_p}{Mf(x)}.
$$
The two bounds then have the same size. If $Mf(x)=0$, the result is immediate. Consequently the <Hedberg inequality> is
$$
\boxed{\ I_\alpha|f|(x)
\leq C_{n,p,\alpha}
\lVert f\rVert_p^{\alpha p/n}
(Mf(x))^{1-\alpha p/n}.\ }
$$
Here the dimensional constant is required for the unnormalized kernel and Lebesgue measure used in the question.