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}.$$