Problem 3-37 (b) reads:
Let $A_{n}=[1-1/2^{n},1-1/2^{n+1}]$. Suppose that $f:(0,1)\rightarrow \mathbb{R}$ satisfies $\int_{A_{n}}f=(-1)^{n}/n$ and $f(x)=0$ for any $x\notin$ any $A_{n}$. Show that $\int_{(0,1)}f$ does not exist, but ${\displaystyle\lim_{\varepsilon\to 0}}\int_{(\varepsilon,1-\varepsilon)}f=\log\,2$.
Note: First that $n\ge 1$ and second that Spivak probably forgot a minus sign, i.e. he intended us to show that ${\displaystyle\lim_{\varepsilon\to 0}}\int_{(\varepsilon,1-\varepsilon)}f=-\log\,2$.
Note: The integrals are to be understood as extended integrals (see p.65 of the book or the image below). Theorem 3-12 (3) links this notion of integral with the old one.
That $\int_{(0,1)}f$ does not exist is not hard to show.
However, it seems to me that ${\displaystyle\lim_{\varepsilon\to 0}}\int_{(\varepsilon,1-\varepsilon)}f=\log\,2$ is not necessarily true. We don´t know how $f$ behaves outside the sets $A_{n}$ and so it may very well be that $\int_{(\varepsilon,1-\varepsilon)}f$ does not exist.
Am I correct in guessing that we need additional hypotheses?
If we assume additional properties of $f$, e.g. that $f$ does not change sign within each set $A_{n}$ and is bounded on each set $A$ then Theorem 3-12 applies and the result is true.
Related issues with other problems and statements about integration in Spivak´s book can be found here and here. .