Lebesgue積分の迷宮

"次の定理の証明を読んで混乱しました。
Theorem: If a function f is Riemann integrable over E, then it is also Lebesgue integrable and the Riemann integral equals the Lebesgue integral. In addition, the function f is continuous almost everywhere on E.
Proof: I believe I comprehend the proof of the first portion of the theorem, as it relies on the upper and lower Riemann sums. It proves that the Lebesgue integrals of functions U and L are equivalent. It then uses another lemma to prove that U and L are equivalent to f, and that the Lebesgue integral of f is thus equivalent to the Riemann integral (summations of U or L). I am not quite clear how the relation of equality between f and U makes their integrals equivalent, but it seems that, if the sums were taken over the same intervals, the integrals would by necessity be equivalent.
The next step is to prove f is continuous. The proof begins with the equivalence of the Lebesgue integrals of U and L. The intent of the proof seems to be to show that, at any point x, the upper bound of f in a neighborhood will equal the lower bound of f in that neighborhood, as the neighborhood shrinks down to a very small size. The definition of "continuous" is that the inverse function of an open set is open. I am not sure how the above logic translates to this definition. At any rate, the fact that the Lebesgue integrals are equivalent indicates that U(x) and L(x) are equivalent except where the measure is zero. I assume this means measures of subsets of the domain of f. I thought that the above proof showed that the functions U and L are absolutely equivalent, so I must be confused by the notation. At any rate, it seems that f is thus continuous everywhere on E-UNIONsubk(Psubk). I guess this is due to the fact that U(x) and L(x) are not equivalent in a partition. However, doesn't a partition of E cover E? So wouldn't E-Psubk equal zero? The proof continues to say that the above UNION expression has measure zero, so f is continuous almost everywhere. I can see that there are a countable number of partitions, but I do not see how they could have measure zero, unless all Lebesgue integrals above are zero.
This notion of zero measure is defined as follows:
E subset R has measure 0 if for all epsilon>0, there exists a countable collection {Isubn} of open intervals with E subset UNION(n=1 to infinity)(Isubn) such that SIGMAsubn(length(Isubn))