The question and its solution are given below:
My questions are:
I am supposed to calculate the Lebesgue integration of the function $f$ on the interval $[0, \pi/2]$, why the solution divides the interval $[0, \pi/2]$ into what is shown in the picture? depending on what theorem? I am suspecting if this solution is correct, could anyone tell me the correct solution?
Thanks!


I think that your solution is not correct.
You must use the fact that the integral of each integrable function $f$ on a set of measure equal to $0$ is $0$.
But $m(cos^{-1}(\mathbb{Q}))=0$, so
$\int_0^{\frac{\pi}{2}}fdx =\int_{[0,\frac{\pi}{2}]\cap cos^{-1}(\mathbb{Q})}fdx + \int_{[0,\frac{\pi}{2}]\cap cos^{-1}(\mathbb{Q})^c}fdx =$
$=0+ \int_{[0,\frac{\pi}{2}]\cap cos^{-1}(\mathbb{Q})^c}fdx=$
$= \int_{[0,\frac{\pi}{2}]\cap cos^{-1}(\mathbb{Q})^c}sin^2(x)dx=$
$= \int_{[0,\frac{\pi}{2}]\cap cos^{-1}(\mathbb{Q})}sin^2(x)dx + \int_{[0,\frac{\pi}{2}]\cap cos^{-1}(\mathbb{Q})^c}sin^2(x)dx=$
$= \int_{[0,\frac{\pi}{2}]}sin^2(x)dx$
Now you can compute this integral because the function $sin^2(x)$ is smooth and the domain of integration is an interval, so the Lebesgue integral is the Riemann integral.