of each to the Riemann sum will be at least and at most . This makes the total sum at least zero and at most . So let be a positive number less than . If it happens that two of the are within of each other, choose smaller. If it happens that some is within of some , and is not equal to , choose smaller. Since there are only finitely many and , we can always choose sufficiently small. Now we add two cuts to the partition for each . One of the cuts will be at , and the other will be at . If one of these leaves the interval [0, 1], then we leave it out. will be the tag corresponding to the subinterval If is directly on top of one of the , then we let be the tag for both intervals: We still have to choose tags for the other subintervals. We will choose them in two different ways. The first way is to always choose a rational point, so that the Riemann sum is as large as possible. This will make the value of the Riemann sum at least . The second way is to always choose an irrational point, so that the Riemann sum is as small as possible. This will make the value of the Riemann sum at most . Since we started from an arbitrary partition and ended up as close as we wanted to either zero or one, it is false to say that we are eventually trapped near some number , so this function is not Riemann integrable. However, it is Lebesgue integrable. In the Lebesgue sense its integral is zero, since the function is zero almost everywhere. But this is a fact that is beyond the reach of the Riemann integral. There are even worse examples. is equivalent (that is, equal almost everywhere) to a Riemann integrable function, but there are non-Riemann integrable bounded functions which are not equivalent to any Riemann integrable function. For example, let be the Smith–Volterra–Cantor set, and let be its indicator function. Because is not Jordan measurable, is not Riemann integrable. Moreover, no function equivalent to is Riemann integrable: , like , must be zero on a dense set, so as in the previous example, any Riemann sum of has a refinement which is within of 0 for any positive number