Suppose we are to evaluate:
$$I = \int_{0}^{1} f(x) dx$$
Where
$$f(x)=\begin{cases}1 \space \text{if} \space x\space \text{is rational}, & \newline 0 \space \text{if} \space x \space \text{is irrational} \\ \end{cases}$$
I have been told that this can be done using measure theory.
Will anyone care to explain how possibly? I am new to measure theory, so I am just researching, please do not say "no attempt shown" this is because I dont know Lebesgue yet, but I heard it has great applications on this?
You can do: $$\begin{align} \int_{[0,1]} f(x)\, {\rm d}{\frak m}(x) &= \int_{[0,1]\cap \Bbb Q} f(x)\, {\rm d}{\frak m}(x) + \int_{[0,1]\cap \Bbb Q^c} f(x)\, {\rm d}{\frak m}(x) \\ &= \int_{[0,1]\cap \Bbb Q} 1\ {\rm d}{\frak m}(x) + \int_{[0,1]\cap \Bbb Q^c} 0 \ {\rm d}{\frak m}(x) \\&= {\frak m}([0,1] \cap \Bbb Q) = 0 \end{align}.$$
The exact definition of $\frak m$ is: ${\frak m}^*E = \inf\{\sum_{n \geq 1}\ell(J_n) \mid J_n \text{ intervals and } E \subseteq \bigcup_{n \geq 1}J_n\}$. Then ${\frak m}\Bbb Q = 0$. Let $\epsilon > 0$ and take a enumeration of $\Bbb Q$, $\{r_1, \cdots, r_n, \cdots\}$. Let $J_n = (r_n - \epsilon/2^{n+1},r_n + \epsilon/2^{n+1})$. Then I leave you to prove that $\Bbb Q \subset \bigcup_{n \geq 1}J_n$ and $\sum_{n \geq 1}\ell(J_n) < \epsilon.$ This in fact proves that any denumerable set has zero measure.