<s>[INST] Riemann-integrable function The following multiple choice question was asked in my exam but I don't know how to proceed:
Define $f:[0,1]\to [0,1]$ by $\displaystyle f(x)=\frac{2^{k}-1}{2^{k}}$ for $\displaystyle x\in [\frac{2^{k-1}-1}{2^{k-1}},\frac{2^{k}-1}{2^{k}}],k\geq 1$. Then $f$ is a Riemann-integrable function such that
1.$\displaystyle \int_{0}^{1}f(x)dx=\frac{2}{3}$
2.$\displaystyle \frac{1}{2}<\int_{0}^{1}f(x)dx<\frac{2}{3}$
3.$\displaystyle \int_{0}^{1}f(x) dx=1$
4.$\displaystyle \frac{2}{3}<\int_{0}^{1}f(x)dx<1$.
I know that function is said to be Riemann-integrable if its upper Riemann-integral and lower Riemann-integral exists and are same.
 [/INST] $$\int_0 ^1f=\int_0^{\frac{1}{2}} \frac{1}{2}+\int_{\frac{1}{2}}^{\frac{3}{4}}\frac{3}{4}+\int_{\frac{3}{4}} ^{\frac{7}{8}}\frac{7}{8}+... =\sum_{k=1}^\infty \int_{\frac{2^{k-1}-1}{2^{k-1}}} ^{\frac{2^k-1}{2^k}} \frac{2^k-1}{2^k}=\sum_{k=1}^\infty (\frac{2^k-1}{2^k})(\frac{2^k-1}{2^k}-\frac{2^{k-1}-1}{2^{k-1}})=\sum_{k=1} ^\infty (\frac{2^k-1}{2^k})(\frac{1}{2^k})=\sum_{k=1} ^\infty \frac{2^k-1}{2^{2k}}=1-\frac{1}{3}=\frac{2}{3}$$
</s>