Let
$$
x_n=\sum_{k=0}^nf\left(\frac{k}{n}\right)-n\int_0^1f(x)dx
$$
We will use the following result:
Lemma If $g:[0,1]\to\mathbb{R}$ is a continuously differentiable function. Then
$$
\frac{g(0)+g(1)}{2}-\int_0^1g(x)dx= \int_{0}^1\left(x-\frac{1}{2}\right)g'(x)dx.
$$
Indeed, this is just integration by parts:
$$\eqalign{
\int_{0}^1\left(x-\frac{1}{2}\right)g'(x)dx
&=\left.\left(x-\frac{1}{2}\right)g(x)\right]_{x=0}^{x=1}
-\int_0^1g(x)dx\cr
&=\frac{g(1)+g(0)}{2}-\int_0^1g(x)dx
}$$
Now applying this to the functions
$x\mapsto f\left(\frac{k+x}{n}\right)$ for $k=0,1,\ldots,n-1$ and adding the resulting inequalities we obtain
$$
x_n-\frac{f(0) +f(1)}{2} = \int_0^1\left(x-\frac{1}{2}\right)H_n(x)dx\tag{1}
$$
where,
$$
H_n(x)=\frac{1}{n}\sum_{k=0}^{n-1}f'\left(\frac{k+x}{n}\right)
$$
Clearly for every $x$, $H_n(x)$ is a Riemann sum of the function continuous $f'$, hence
$$
\forall\,x\in[0,1],\quad\lim_{n\to\infty}H_n(x)=\int_0^1f'(t)dt
$$
Moreover, $| H_n(x)|\leq\sup_{[0,1]}|f'|$. So,
taking the limit in $(1)$ and
applying the Dominated Convergence Theorem, we obtain
$$
\lim_{n\to\infty}\left(x_n-\frac{f(0) +f(1)}{2}\right)=
\left(\int_0^1f'(t)dt\right)\int_0^1\left(x-\frac{1}{2}\right)dx=0.
$$
This proves that
$$
\lim_{n\to\infty}x_n=\frac{f(0) +f(1)}{2}
$$
And consequently
$$
\lim_{n\to\infty}\left(\sum_{k=\color{red}{1}}^nf\left(\frac{k}{n}\right)-n\int_0^1f(x)dx\right)=\frac{f(1)-f(0)}{2}
$$
First, prove that $\sum_{n\ge 0} \frac {x^n}{n!}$ and $\sum_{n\ge 0} \frac{y^n}{n!}$ converge absolutely by using the Ratio Test and compute their Cauchy Product:
$$
\begin{align}
\left(\sum_{n\ge 0} \frac {x^n}{n!}\right)\left(\sum_{n\ge 0} \frac {y^n}{n!}\right)&=\sum_{n\ge 0} c_n = \sum_{n\ge 0} \sum_{i=0}^n \frac{x^i}{i!}\frac{y^{n-i}}{(n-i)!} \\ &=\sum_{n\ge 0} \sum_{i=0}^n \frac 1{n!}\binom{n}{i}x^iy^{n-i}=\sum_{n\ge 0}\frac 1{n!}(x+y)^n
\end{align}
$$
Where we used the Binomial Theorem in the last equality.
Best Answer
There are two kind of ways to extend the Riemann integral to unbounded sets. First is the one that you would probably guess first $$ \int_0^\infty f(x) dx = \lim_{b \to \infty}\int_0^b f(x)dx $$ as long as the integrals on the right exist for all $b$ and the limit on the right hand side exists. The other way is to say a sequence of unions of disjoint compact intervals $E_i = \cup_{k=1}^{n_i}[a_k,b_k]$ exhausts a set $E$ if $E_{i+1} \supseteq E_i$ and $\cup_{i=1}^\infty E_i = E$. (I will stick to unions of disjoint unions of intervals in order to avoid discussion about Peano-Jordan measurability, which you may look up if you wish.) Then you can define $$ \int_0^\infty f(x)dx = \lim_{n\to \infty} \int_{E_i} f(x)dx $$ whenever the limit on the right exists and is independent of the exhausting sequence $E_i$.
At first these definitions may look similar, but consider $$\int_0^\infty \frac{\sin(x)}{x} dx$$ If you take the limit as $b \to \infty$ as in the first definition, you get $\frac{\pi}{2}$. However, if you take the second definition, you will find that the integral does not exist because the integral of the positive portion and the negative portion are both $\infty$.
One thing that is easy to see is that if $f \geq 0$ is continuous, then the two kinds of integrals with both exist and equal eachother. Thus, of $f^+,f^-\geq 0$ are the positive and negative parts of $f$ and $$\int_0^\infty f^+(x)dx,\int_0^\infty f^-(x)dx < \infty$$ or equivalently $\int_0^\infty |f(x)| dx < \infty$, then the two kinds of integrals with both exist, be finite, and equal eachother.
Now to answer your question. Let's suppose that $f$ is continuous and $\int_0^\infty |f(x)|dx < \infty$. Let's investigate when $$\lim_{n\to\infty}\frac{1}{n}\sum_{k \geq 0} f\left(\frac{k}{n}\right) = \int_0^\infty f(x)dx.$$
Write $$ \frac{1}{n}\sum_{k \geq 0} f\left(\frac{k}{n}\right) = \sum_{m=0}^\infty \frac{1}{n}\sum_{k = mn}^{(m+1)n-1}f\left(\frac{k}{n}\right) = \sum_{m=0}^\infty S(f;1/n;[m,m+1]) $$ Where $S(f;\Delta x,[a,b])$ denotes the left Riemann sum of $f$ of width $\Delta x$ over the interval $[a,b]$. Since $f$ is continuous on $[m,m+1]$ for every $m$, we have $S(f;1/n;[m,m+1]) \to \int_{m}^{m+1} f(x)dx$ as $n \to \infty$. Then what we would like to say is that $$ \lim_{n\to \infty}\sum_{m=0}^\infty S(f;1/n;[m,m+1]) = \sum_{m=0}^\infty\lim_{n\to \infty} S(f;1/n;[m,m+1]) $$ $$ =\sum_{m=0}^\infty \int_{m}^{m+1} f(x)dx = \int_{0}^\infty f(x)dx $$ so what let's us justify these steps? The second equality is just definition, and since we assumed $\int_0^\infty |f(x)|dx < \infty$ we don't have to worry about the last equality since we know that $\{\cup_{m=0}^k[m,m+1]\}_k$ is an exhausting sequence of $[0,\infty]$ (single point overlap is okay, don't worry), so all that we have to justify is the first one, exchanging the limit and sum.
Let $S^*$ and $S_*$ represent the upper and lower Riemann sums respectively. Then of course $$ S_*(f;1/n;[m,m+1]) \leq S(f;1/n;[m,m+1]) \leq S^*(f;1/n;[m,m+1]) $$ and of more importance for this problem $$ |S_*(f;1/n;[m,m+1])|, |S^*(f;1/n;[m,m+1]) | \leq S^*(|f|;1/n;[m,m+1]) $$ Then one sufficient case to be able to exchange the sum and the limit is that for some $n$ $$\sum_{m=0}^\infty S^*(|f|;1/n;[m,m+1]) < \infty.$$ The justification for this is that you are bounding the partial sums by an integrable function and thus may apply Lebesgue's dominated convergence theorem. As a corollary, we get the friendly
Proof. $$\sum_{m=0}^N S^*(|f|;1;[m,m+1]) \leq S^*(g;1;[0,N+1]) \leq g(0) + \int_{0}^{N+1} g(x)dx \leq g(0) + \int_0^\infty g(x)dx$$ for all $N$. Thus $$\sum_{m=0}^\infty S^*(|f|;1;[m,m+1]) \leq g(0) + \int_0^\infty g(x)dx < \infty. $$
Also note, that you only really need $|f(x)| \leq g(x)$ for all $x>x_0$ for some fixed $x_0$.