I was wondering whether there is an integral analogue of the Riemann series theorem. That is if $f:\mathbb{R}\to\mathbb{R}$ is a function such that $\int_\infty^\infty f(x)dx$ doesn't exist, is there then, for any $a\in\mathbb{R}$ two functions $g(t), h(t)$ such that $lim_{t\to\infty}g(t)=\infty=lim_{t\to\infty}h(t)$ and such that $$lim_{t\to\infty}\int_{-h(t)}^{g(t)}f(x)dx=a$$ After a bit of pondering this is false in general, like if $f(x)=1$, but I am wondering what hypothesis I can strengthen and what conclusion I can weak, for it to become true. My best guess so far is that there should exist at least one such pair $(g,h)$ so that the limit is equal to something. But I can't seem to conclude anything more.
Any help is appreciated, thanks