Let $f(x)$ be an integrable function on $[0,1]$ that obeys the property $f(x)=x, x=\frac{n}{2^m}$ where $n$ is an odd positive integer and m is a positive integer. Calculate $\int_0^1f(t)dt$
My attempt:-
Any positive even number can be written as the sum of two positive odd integers. So, $f(x)=x, \forall x\in \{n/2^m:n,m\in \mathbb Z^+\}.$ I know the set $\{n/2^m:n,m\in \mathbb Z^+\}$ is dense in $[0,1]$.
Define $g(x)=f(x)-x$, if $f$ is continuous, I could say that $f(x)=x$ using the sequential criterion of limit. Hence,$\int_0^1f(t)dt=\frac{1}{2}$ How do I proceed for non-continuous function?
If $f$ is Riemann integbrable it is continuous almost everywhere. This shows that $f(x)=x$ almost everywhere (since the equation holds on a dense set). Hence the integral is $\int_0^{1} xdx =\frac 1 2 $.