Integration Real Analysis Let $E=\{1/n:n\in\mathbb{N}\}$ and consider the function on $[0,1]$ defined by $$f(x)=\begin{cases}\,1, &x\in E\\\,0,&\text{otherwise}\end{cases}.$$
Prove that $f$  is integrable on $[0,1]$ and find the value of  $\int_0^1 f(x)\,dx$. Hint: This involves a rather clever construction of  a partition which makes use of the fact that $1/n\downarrow 0$ as $n\to\infty$.
 A: $\forall n \in \Bbb N, P_n : \int\limits_{1/n}^1 f(t)dt=\int\limits_{1/n}^1 1 dt$
$P_0$ is true because both sides are $0$
Suppose $P_n$
$\int\limits_{1/n}^1 f(t)dt=\int\limits_{1/n}^1 1 dt$
$\int\limits_{1/(n+1)}^{1/n}f(t)dt+\int\limits_{1/n}^1 f(t)dt=\int\limits_{1/(n+1)}^{1/n}1dt+\int\limits_{1/n}^1 1 dt$ because between $1/n$ and $1/(n+1)$, $f(t)=1$
$\int\limits_{1/(n+1)}^1 f(t)dt=\int\limits_{1/(n+1)}^1 1 dt$
So by recurrence, $\boxed{\forall n \in \Bbb N, \int\limits_{1/n}^1 f(t)dt=\int\limits_{1/n}^1 1 dt}$

$\forall n \in \Bbb N, 0\le\int\limits_0^{1/n} f(t)dt \le \int\limits_0^{1/n} 1dt = 1/n \underset{n\to +\infty}{\longrightarrow} 0$ so $\boxed{\int\limits_0^{1/n} f(t)dt\underset{n\to +\infty}{\longrightarrow} 0}$

$\int\limits_{1/n}^1 f(t)dt=\int\limits_0^1 f(t)dt-\int\limits_0^{1/n} f(t)dt \underset{n\to +\infty}{\longrightarrow} \int\limits_0^1 f(t)dt$
$\int\limits_{1/n}^1 f(t)dt=\int\limits_{1/n}^1 1 dt= 1 - 1/n \underset{n\to +\infty}{\longrightarrow} 1$
So $\boxed{\int\limits_0^1 f(t)dt=1}$

A more general result is that if two functions differ only at countably many points, they have the same integral, countably many meaning you can find a sequence $u_n$ that takes all of them as value for a given $n$.
