Prove that this function is not Riemann-integrable

Let $A\subset[0,1]$ be the union of open intervals $(a_i,b_i)$ such that each rational number in $(0,1)$ is contained in some $(a_i,b_i)$ and $\sum_i(b_i-a_i)<1$. It can be shown that $\partial A$ does not have measure zero. Show that if $f=\chi_A$ except on a set of measure zero, then $f$ is not integrable in $[0,1]$.

So, let $D$ be this set having measure zero. We may write:$$f(x) = \begin{cases}1,& \text{ if } x\in A\setminus D\\ 0,& \text{ if } x\notin A\cup D\\ g(x) ,& \text{ if } x\in D.\end{cases}$$ for some function $g$. If I could show that the set of discontinuities of $f$ does not have measure zero (for instance proving it contains $\partial A$), then we would be done. However that's the problem. What do you suggest?

• Some things are not clear. $A=\bigcup_{n \ge 2}(\frac{1}{n},1-\frac{1}{n})$ is such that each rational is contained in one interval $(\frac{1}{n},1-\frac{1}{n})$. However $\partial A$ is of measure $0$. – mathcounterexamples.net Aug 6 '15 at 14:59
• I missed the following $\sum(b_i-a_i)<1$ – Dude Aug 6 '15 at 15:05
• I edited right now – Dude Aug 6 '15 at 15:05
• @mathcounterexamples.net let $0<a<1$. Take the length of $(a_i,b_i)$ less than $a/2^i$ – Dude Aug 6 '15 at 15:16

First step: $A\setminus D$ is dense in $[0,1].$ Proof: Let $U \subset [0,1]$ be open. Then $A \cap U \ne \emptyset.$ Because both sets are open, $A \cap U$ is open. A nonempty open set has positive measure. The removal of a set of measure zero can't change that. Hence
$$(A\cap U)\setminus D =(A\setminus D)\cap U \ne \emptyset,$$
Now think about $A^c \setminus D.$ This is a set of positive measure. Let $x\in A^c \setminus D.$ Then from above we see there is a sequence $x_n$ in $A\setminus D$ converging to $x$ such that $f(x_n) = 1$ for all $n.$ Because $f(x) =0,$ $f$ is discontinuous at $x.$ Thus the set of discontinuities of $f$ contains a set of positive measure and we're done.