I know that, $$\int_{a}^b f(x) \, \mathrm{d}x = \lim\limits_{n \to ∞} \dfrac{b-a}{n} \sum\limits_{r=1}^n f \left( a + r\left(\dfrac{b-a}{n}\right) \right)$$
Then using that, does the following result hold?
$$\lim\limits_{n \to ∞} \dfrac{1}{n} \sum\limits_{r=g_1(n)}^{g_2(n)} f\left(\dfrac{r}{n}\right) = \int_{\lim\limits_{n\to ∞} \frac{g_1(n)}{n}}^{\lim\limits_{n\to ∞} \frac{g_2(n)}{n}} f(x)\, \mathrm{d}x, $$ where $g_1,g_2 : \mathbb{N}\to \mathbb{N}$ and $g_1(n)≤g_2(n), \, \forall n$
(What are the conditions on $g_i(n)?$)
I vaguely recall studying something like that, for example:
$$\lim\limits_{n \to ∞} \dfrac{1}{n} \sum\limits_{r=n}^{3n} f\left(\dfrac{r}{n}\right) = \int_{1}^{3} f(x)\, \mathrm{d}x$$
I can't seem to find the "exact" result, so I have tried to reconstruct from what I can recall, so some details might be missing. Can anybody point me to that result? I know only one Youtube video that talks about this result but the video is not in English.
Edit: See this, for example. Although the answer to that question doesn't quite answer it but it's something.