f(x)= 0 if x=0,1/2,1/3,1/4,..
So the upper sum is always 1, and I want to show that the upper sum - lower sum is less than epsilon. But how do I proceed for the lower sum?
If you have baby Rudin (Principles of Math. Analysis), see Theorem 6.6. The idea I'm thinking of is to take a partition that includes the points you listed except near zero where you can control the width of the "last" segment in the domain. Then add points near the finite number of points from your list. Then you can control the width on which the inf is zero. On the remaining partitions (most of the area) the inf. is 1. So the lower sum can get arbitrarily close to 1.
It's important that you get this one on your own. You're up to it ... I can tell from the initial post. Use the technique I outlined; it gives you a key idea used in many problems in real analysis (Lebesgue integration) later. So it's important to your development.
To help you start, choose some . Then choose so that . Now you have a finite number of points outside the segment and still have to spend. Choose intervals that contain the remaining (finite number of) points in a way that serves your purpose.