Question:

Let $\displaystyle Q $ be a rectangle in $\displaystyle \mathbb{R}^n $. Let $\displaystyle S \subset Q $. Consider the characteristic function of S on Q given by $\displaystyle f_s (x) = 1 $ if $\displaystyle x \in S $, and $\displaystyle f_s (x) = 0 $ otherwise. Prove that $\displaystyle f_s $ is integrable if and only if bd(S) has measure 0.

I don't see how this can be true. Take Q to be the unit interval [0,1], and let S be the set of irrationals in [0,1]. bd(S) is the set of rationals in [0,1], which has measure 0, but the integral of $\displaystyle f_s $ doesn't exist, because for any partition P the upper sum is 1 and the lower sum is 0. Am I correct in my thinking?