Riemann integral enigma I tried to solve this problem from Souza Silva - Berkeley Problems In Mathematics:

In the Solutions part, I founded next solution for this problem:

I do not understand the last statement, so why $|f|\in R[0,1] \implies f \in R[0,1]$? It is clear for me that is false...Or what am I wronging here?
 A: I'm not sure what the given solution was trying to do. But by Lebesgue's criterion, a bounded function that's continuous almost everywhere is Riemann-integrable. The hypothesis guarantees that for each positive integer $n$, the set of discontinuities of $f$ in $[1/n,1]$ has measure zero. Thus the set of discontinuities of $f$ is a countable union of sets of measure zero, so it has measure zero itself. Together with boundedness, this implies $f$ is integrable.
A: I think the point of the exercise is to prove integrability under these conditions (perhaps as an improper integral), without invoking Lebesgue's criterion or the more powerful tools available for Lebesgue integration -- simply using that $|f(x)|$ is bounded.
It is stated that $f$ is Riemann integrable over $[b,1]$ for all $b$ such that $0 < b \leq 1.$ 
The integral over $[0,1]$ is potentially improper at the endpoint $x=0$. Since $f$ is bounded, this rules out cases like $f(x) = 1/\sqrt{x}.$  However we could be considering a case such as the improper integral
$$\int_{0}^{1} \sin (1/x) \, dx.$$
Note that this improper integral exists and is absolutely convergent as well:
$$\int_{0}^{1} |\sin (1/x)| \, dx= \int_{1}^{\infty} \frac{|\sin x|}{x^2} \, dx  <\int_{1}^{\infty} \frac{1}{x^2} \, dx=1.$$
We say that $f$ has an improper integral over $[0,1]$ if the following limit exists 
$$\lim_{c \rightarrow 0}\int_{c}^{1} f(x) \, dx.$$
A necessary and sufficient condition for the improper integral to exist is the Cauchy criterion: for every $\epsilon > 0$ there exists $\delta > 0 $ such that if $0 < c_1 < c_2 < \delta$ then
$$\left|\int_{c_1}^{c_2} f(x) \, dx\right| < \epsilon.$$
Since $|f(x)| \leq M$ for $x \in (0,1]$ we have 
$$\left|\int_{c_1}^{c_2} f(x) \, dx\right| \leq  \int_{c_1}^{c_2} |f(x)| \, dx\leq M|c_2-c_1|.$$  Choosing $\delta = \epsilon/M$ it follows that if  $0 < c_1 < c_2 < \delta$ then
$$\left|\int_{c_1}^{c_2} f(x) \, dx\right| < \epsilon,$$
and the existence of the improper integral of $|f|$ implies the same is true for $f$.
