Evaluating $\lim_{n\to\infty} \frac{1^{99} + 2^{99} + \cdots + n^{99}}{n^{100}}$ using integral 
Evaluate $\lim\limits_{n\to\infty} \dfrac{1^{99} + 2^{99} + \cdots + n^{99}}{n^{100}}$

This is the question I remembered from my high school textbook (I remembered it while reading about something related). Now I know how to do it using Faulhaber's formula (at least the first coefficient, which is required). But the textbook used this method which I didn't and don't understand. $$\lim\limits_{n\to\infty} \dfrac{1^{99} + 2^{99} + \cdots + n^{99}}{n^{100}} = \lim\limits_{n\to\infty}\dfrac{\large\int\limits_{0}^n x^{99} dx}{n^{100}} = \lim\limits_{n \to \infty}\dfrac{\dfrac{n^{100}}{100}}{n^{100}}= \dfrac{1}{100}$$
What I don't understand how is converting from sum to integral is justified (the textbook didn't justify) and when is it allowed to replace sum by integral?

Since for $x\in(k,k+1)$ we have
$$k^{99} \le x^{99} \le (k+1)^{99}$$
we get
$$k^{99} = \int_k^{k+1} k^{99} \,\mathrm{d}x \le \int_k^{k+1} x^{99}\,\mathrm{d}x \le \int_k^{k+1} (k+1)^{99} \,\mathrm{d}x = (k+1)^{99}.$$
This yields
$$\sum_{k=0}^{n-1} k^{99} \le \int_0^{n} x^{99}\,\mathrm{d}x \le \sum_{k=0}^{n-1} (k+1)^{99}\\
1^{99}+2^{99}+\dots+(n-1)^{99} \le \int_0^{n} x^{99}\,\mathrm{d}x \le 1^{99}+2^{99}+\dots+{n}^{99}.$$
Dividing by $n^{100}$ we get
$$\frac{1^{99}+2^{99}+\dots+(n-1)^{99}}{n^{100}} \le \frac{\int_0^{n} x^{99}\,\mathrm{d}x}{n^{100}} \le \frac{1^{99}+2^{99}+\dots+{n}^{99}}{n^{100}}.$$
Since
$$\left(\frac{1^{99}+2^{99}+\dots+{n}^{99}}{n^{100}}-\frac{1^{99}+2^{99}+\dots+(n-1)^{99}}{{n}^{100}}\right) = \frac1n \to 0$$
we get that all three expression above have the same limit for $n\to\infty$. (Provided that the limit exists at least for one of them.)

What we did above is basically comparing integral (area under the curve) with a sum (area given by the steps in the following image):

I have taken this picture from this answer.
Basically the same derivation is given in this answer
