$\int_{0}^1(f(x))dx$ where $f(x)=1-\frac{1}{n}$ when $x=\frac{1}{n}$ and $f(x)=0$ when $x \ne \frac{1}{n}$ Is $\int_{0}^1(f(x))dx=0$  where $f(x)=1-\frac{1}{n}$ when $x=\frac{1}{n}$ and $f(x)=0$ when $x \ne \frac{1}{n}$?
I am trying to find examples of integrable functions such that $f(x)<g(x), x \in [a,b]$ but
$1$)$\int_{a}^b(f(x))dx <  \int_{a}^b(g(x))dx$
$2)$$\int_{a}^b(f(x))dx = \int_{a}^b(g(x))dx$
I came up with this example and I took $g(x)=1+\frac{1}{n}$ and $g(x)=1$ when $x \ne \frac{1}{n}$.
However I am not sure how to integrate $f,g$.I have this intuition that they are  riemann integrable.How do I show they are integrable.Also,I have taken this example as to prove $2$ ,I think that any  2 continuous function will satisfy the condition $1$
 A: *

*Consider any partition $P$ of $[0,1]$. Then $L(P,f) = 0$.

Define the following partition $P_n := \{0 , \frac{1}{n} , \frac{1}{n-1} - \epsilon_n , \frac{1}{n-1} + \epsilon_n ,  \frac{1}{n-2} - \epsilon_n , \frac{1}{n-2} + \epsilon_n, .... 1 \} $ where $\epsilon_n = \frac{1}{2}(\frac{1}{n-1} - \frac{1}{n}) = \frac{1}{2n(n-1)}$.
Then $U(P_n,f) = \frac{1}{n} + \sum_{i = 1}^{n-1}  2\epsilon_n (1 - \frac{1}{i}) \leq \frac{1}{n} + 2(n-1)\epsilon_n - 2\epsilon_n = \frac{1}{n} + 2(n-2)\epsilon_n $
Clearly $U(P_n, f) \rightarrow 0$ as $n \rightarrow \infty$. To show that $U(P,f) \rightarrow 0$ as $||P|| \rightarrow 0$ for any partition $P$, we just need to observe that for any partition $P$, there is a refinement $P'$ of $P$, s.t. $U(P',f) = U(P_n,f)$ for some $n$.
Qed.


*a. $[a,b] = [0,1] , f(x) = 1 , g(x) = 2$
b. This cannot hold.
If $I$ is a compact interval, s.t. $M = \max_{x \in I} f$ and $m = \min_{x \in I} g$, then $M < m$. Let $\lambda = \frac{M+m}{2}$. Then:
$$\int_{I} f(x)dx < \lambda |I| < \int_{I} g(x)dx $$
If $I$ is not compact, but a measurable space it is still not possible, but the proof is a little more complex.
Intuition behind partition: Intuitively we know that the $U(P,f) = 0$ for very small $||P||$, as the function is 0, except at countably many points. How do we construct such a partition? Two key observations are:
(1) In one subinterval of $P$, accumulate all but finite points of the discontinuity (we know that whatever maximum finite value the function achieves on this subinterval is irrelevant, as when $||P|| \rightarrow 0$, this subinterval's contribution to the sum goes to $0$. In my example, this subinterval is $[0,\frac{1}{n}]$.
(2) Now the number of remaining points of discontinuity are finite. The key idea here is that $P$ must contain each of these points separately in small subintervals,  so that as $||P|| \rightarrow 0$, the contribution of these points to the upper riemann sum goes to $0$. In the above partition the remaining finite points of discontinuity are $\{\frac{1}{n-1}, \frac{1}{n-2} , ... 1 \}$. So for each point $\frac{1}{i}$, I contain it in the subinterval $[\frac{1}{i} - \epsilon, \frac{1}{i} + \epsilon]$, where I just pick $\epsilon$ as any value so that no two intervals overlap i.e. $ \frac{1}{i} + \epsilon < \frac{1}{i-1} - \epsilon$ forall $i$.
