Problem: Define a function f by $\displaystyle f(x)= \begin{cases} x, \quad& 0 \le x \le 1 \\0, \quad& otherwise \end{cases}.$

Given that $\displaystyle \mu $ is the Lebesgue measure on $\displaystyle \mathbb {R} $ i.e. $\displaystyle \mu ((a,b)) = b-a$

Show that $\displaystyle \int f d \mu = \frac {1}{2} $

My proof so far:

Using the hints in the text, I'm defining a series of function $\displaystyle f_n$ that converges to $\displaystyle f$, with $\displaystyle \int f_n d \mu \rightarrow \int f d \mu $

For $\displaystyle x \in (0,1] $, let $\displaystyle f_n(x) = \frac { [2^nx]}{2^n} $ where $\displaystyle [x] $ a rounded down to the nearest integer.

$\displaystyle f_n(x)= \begin{cases} \frac { [2^nx]}{2^n}, \quad& x \in (0,1] \\ 0, \quad& otherwise \end{cases}.$

Then I have $\displaystyle \int f_n (x) d \mu = \sum ^n _{k=1} ( \frac {1}{2^k} ) \mu \{ ( \frac {1}{2^k} , \frac {1}{2 ^{k-1}} ) $

$\displaystyle = \sum ^n _{k=1} \frac {1}{4^k} $

$\displaystyle \frac {1}{3} $

But the answer is suppose to be $\displaystyle \frac {1}{2} $! I'm guessing my integration of the series of function is wrong, but why?