A Problem on Improper Integrals
Let $f(x)$ be continuous except at $x = 0$ and let $a > 0$. Assume that the improper integral $$\int_{0}^{a}f(x)\,dx = \lim_{\epsilon \to 0+}\int_{\epsilon}^{a}f(x)\,dx$$ exists and let $$g(x) = \int_{x}^{a}\frac{f(t)}{t}\,dt$$ Show that $$\int_{0}^{a}g(x)\,dx = \int_{0}^{a}f(x)\,dx$$
I tried integration by parts noting that $g'(x) = -f(x)/x$ and obtained for $0 < \epsilon < a$ the following $$\int_{\epsilon}^{a}g(x)\,dx = [xg(x)]_{x = \epsilon}^{x = a} - \int_{\epsilon}^{a}xg'(x)\,dx$$ or $$\int_{\epsilon}^{a}g(x)\,dx = -\epsilon g(\epsilon) + \int_{\epsilon}^{a}f(x)\,dx$$
The problem is solved if we can somehow show that $\lim_{\epsilon \to 0+}\epsilon g(\epsilon) = 0$. Looking at the definition $g(x)$ we see that we have no information of the behavior of $f(t)$ at $t = 0$ and the $t$ in denominator complicates the analysis of $g(\epsilon)$. Please suggest some hints which can lead to the solution.
Note: This problem is taken from G. H. Hardy's "A Course of Pure Mathematics" 10th ed. Page 397.
Hint: Define $$h(x)=\int_x^af(t)dt,\ \forall x\in[0,a].$$ Then for every $x\in(0,a]$, $$g(x)=-\int_x^a\frac{h'(t)}{t}dt=\frac{h(x)}{x}-\int_x^a\frac{h(t)}{t^2}dt=\frac{h(x)}{a}+\int_x^a\frac{h(x)-h(t)}{t^2}dt.$$
Given $\delta\in(0, a]$, denote $$M_\delta=\max_{x,y\in[0,\delta]}|h(x)-h(y)|.$$ When $x\in(0,\delta)$, $$|g(x)-\frac{h(x)}{a}|\le \int_x^\delta\frac{|h(x)-h(t)|}{t^2}dt+\int_\delta^a\frac{|h(x)-h(t)|}{t^2}dt\le \frac{M_\delta}{x}+\frac{M_a}{\delta}.$$
To prove $\lim\limits_{x\to0}xg(x)= 0$, let $\epsilon > 0$. Choose $ x_0$ such that $ 0<x<x_0 \implies |\int_x^{x_0}f(t)\, dt|<\epsilon$. For such $ x $ we have
$$ xg(x) = x\int_{x_0}^a\frac{f(t)}{t}dt+x\int_{x}^{x_0}\frac{f(t)}{t}dt$$
The first term on the right $\to 0$ as $x\to 0^+$. To estimate the second term, set $ F(x) = \int_x^{x_0}f(t)\,dt$ and integrate by parts:
$$ \int_{x}^{x_0}\frac{f(t)}{t}dt =\frac{-F(t)}{t}\bigg |_{x}^{x_0}-\int_{x}^{x_0}\frac{F(t)}{t^2}dt$$
the fact that $|F|<\epsilon $
$$|x\int_{x}^{x_0}\frac{f(t)}{t}dt| < 3\epsilon $$
We get that $\limsup\limits_{x\to 0^+} |xg(x)|\le 3\epsilon$