$\textbf{Problem Statement :}$ Let $f$ be a real valued function defined on $\mathbb{R}$. Suppose that $\lim_{n \rightarrow \infty} \sum_{i = 1}^n \frac{1}{n}f\left(\frac{i}{n}\right)$ exists and is equal to two.
The first part of this question asks whether $\int_0^1 f(x)$ exists and if it exists, whether it must be equal to $2$, and the second part of this question asks you to consider the same question when $f$ is continuous.
In the first part, I think it is not necessary that the integral exists nor must it be equal to two if it does. We can say that the function is unbounded on the irrationals as a case to when the integral does not exist, and take a function which is 0 on all irrationals but whatever it needs to be on the rationals so the limit of that sum converges, as this integral would be equal to $0$.
However when the function is continuous, we are certain that this integral must exist, since by continuity, $\lvert U_n(f,P) - L_n(f,P)\rvert \leq \lvert \sum_{i=1}^n (M_i - m_i)\frac{1}{n}\rvert \leq \epsilon \sum_{i = 1}^n \frac{1}{n} = \epsilon$. To show that the value is $2$, we see that $m_i \leq f\left(\frac{1}{n}\right) \leq M_i$. However here, I have some trouble since I cannot use a 'reverse squeeze theorem' to claim that $\lim_{n \rightarrow \infty} \vert U_n(f,P) - 2 \vert < \epsilon$ or same with lower partition. If someone could give me a slight nudge on how to proceed, I would be grateful.
For $f=2\chi_{{\bf{Q}}}$ on $[0,1]$, $f$ is not Riemann integrable but $\displaystyle\sum_{i=1}^{n}\dfrac{1}{n}f\left(\dfrac{i}{n}\right)=\sum_{i=1}^{n}\dfrac{2}{n}=2\rightarrow 2$.