Rigorous proof of convergence of sum to a integral I wish to prove the following statement rigorously:
Let $g:[0,1]\longrightarrow \mathbb{R}$ be a Riemann integrable function. Then
\begin{equation*}
\lim_{n\rightarrow\infty} \frac{1}{n}\sum_{t=1}^n g\left( \tfrac{t}{n}\right) = \int_0^1 g(r)dr
\end{equation*}
This picture of this proof is obvious but I am trying to prove it with epsilons and delta's and I just can't seem to put all the pieces together.
Could someone please help! Thanks
PS: I should say that the original statement I wished to prove was actually just for $g\in C[0,1]$, but I couldn't see why this would not just hold for more generally riemann integrable functions.
 A: I hope that the following definition of Riemann integral is the one you have learnt:
$f:[a,b]\rightarrow{\bf{R}}$ is said to be Riemann integrable with value $I$ if for every $\epsilon>0$, there exists some $\delta>0$ such that for every partition $P=\{x_{0},...,x_{n}\}$ of $[a,b]$ with $\max_{1\leq i\leq n}|x_{i}-x_{i-1}|<\delta$, we have 
\begin{align*}
\left|\sum_{i=1}^{n}f(c_{i})(x_{i}-x_{i-1})-I\right|<\epsilon,
\end{align*}
where $c_{i}\in[x_{i-1},x_{i}]$, $i=1,...,n$.
Then for your question, choose positive integer $N$ large enough such that $1/N<\delta$, for all $n\geq N$, set $P_{n}=\{0,1/n,...,(n-1)/n,1\}$, $c_{i}=1/n$, we have
\begin{align*}
\left|\sum_{i=1}^{n}f\left(\dfrac{i}{n}\right)\dfrac{1}{n}-\int_{0}^{1}f(x)dx\right|<\epsilon.
\end{align*}
From Darboux to Riemann sum: Denote $U(f)$ the infimum of the set of all upper sums $U(f,P)$ for $f$ and similar to the $L(f)$. Given $\epsilon>0$, choose a partition $P_{0}$ such that $U(f,P)<U(f)+\epsilon$ and $L(P,f)>L(f)-\epsilon$. Let $\alpha>0$ be such that $\sup_{x\in[0,1]}|f(x)|\leq\alpha$. Assume the partition $P_{0}$ consists of $n_{0}$ points, now we take $\delta=\epsilon/(n_{0}\alpha)$. For any partition $P=\{x_{0},...,x_{m}\}$ of $[0,1]$ such that $\|P\|<\delta$, denote $P^{\ast}$ the common partition of $P$ and $P_{0}$, then of course $U(P^{\ast},f)\leq\min\{U(P,f),U(P_{0},f)\}$. 
We observe that for any other point $x^{\ast}$ which lies in $P^{\ast}$ but not $P$ must lie in an open interval $(x_{i-1},x_{i})$ where $x_{i-1},x_{i}$ are points of $P$. So for the part of $U(P,f)-U(P^{\ast},f)$ about $x^{\ast}$, denoting $M_{1}=\sup_{x\in[x_{i-1},x^{\ast}]}|f(x)|$, $M_{2}=\sup_{x\in[x^{\ast},x]}|f(x)|$ we have 
\begin{align*}
& M_{i}(f)(x_{i}-x_{i-1})-M_{1}(x^{\ast}-x_{i-1})-M_{2}(x_{i}-x^{\ast})\\
&=(M_{i}(f)-M_{1})(x^{\ast}-x_{i-1})+(M_{i}(f)-M_{2})(x_{i}-x^{\ast})\\
&\leq 2\alpha[(x^{\ast}-x_{i-1})+(x_{i}-x^{\ast})]\\
&\leq 2\alpha\|P\|,
\end{align*} 
since the total number of points in the partition $P_{0}$ is $n_{0}$, we have $U(P,f)-U(P^{\ast},f)\leq n_{0}\cdot 2\alpha\|P\|<\epsilon$.
The rest is easy since the Riemann sum $S(P,f)\leq U(P,f)<U(P^{\ast},f)+\epsilon<U(P_{0},f)+\epsilon<U(f)+2\epsilon$ and we can do similar estimation for $L(P,f)$.
