There is a very general theorem which does away with this, but assuming that you don't know this theorem here's what I would do:
Start by considering . Consider then the intervals
Notice then that if
Then . Note though that and so by continuity of on we may find partitions such that . Note next that is a partition for and
Note though that by construction and ,since ,
And thus and since (after taking the min of and or any ) was arbitrary it follows that[ math]f[/tex] is integrable. Thus,
where we've used the obvious fact that for any and since that .
Assuming that n is a fixed natural number and k must be an integer, then k/n is in [0, 2] only for k= 0, 1, 2, ..., 2n. That is, f(x) is continuous every where except on the finite set {0, 1/n , 2/n, ..., 2}. Every finite set has Lebesque measure 0 so f is continuous except on a set of measure 0 and so is Riemann integrable. its integral is exactly [itex]\int_0^2 x^3dx= 4[/itex].