Let $E=[0, \pi]\cup[2\pi,3\pi]\cup\mathbb{Q}\subset \mathbb{R}$ and $f(x)=$sin$(x)$. Also, $\lambda$ is the Lebesgue measure on $\mathbb{R}$.
How to compute $\int_E f \ d \lambda$?
I used
$\int_E f \ d \lambda=\int_{0}^{\pi}$sin$(x) \ d \lambda +\int_{2\pi}^{3\pi}$sin$(x)\ d \lambda +\int_\mathbb{Q}$sin$(x)\ d \lambda $.
With $\int_{0}^{\pi}$sin$(x)\ d \lambda\approx0,08611$,
$\int_{2\pi}^{3\pi}$sin$(x)\ d \lambda\approx0,42924$ and
$\int_\mathbb{Q}$sin$(x)\ d \lambda =0$
So $\int_E f \ d \lambda = 0,08611+0,42924= 0,51535$
I'm not sure if this result is correct, since I didn't use the characteristic function or the simple function.
Your method is fine but I winder how you got those numerical values. In fact $\int_0^{\pi}\sin\,x \, dx=2$ and $\int_{2\pi}^{3\pi}\sin\,x \, dx=2$. Therefore $\int_E \sin\,x \, dx=4$.