When you look at the iterative construction of P (where you remove middle thirds recursively), you will notice that at each step, the part you haven't removed yet (which of course contains P) consists of a collection of intervals, call it C_n. So partition [0,1] using one of those collections, and consider the upper and lower sums for that partition. There are two cases: an interval does not belong to C_n, in which case f is continuous there, or the interval does belong to C_n, in which case you can put a bound on the contribution of that interval to the integral, using boundedness of f and the fact that the lengths of those intervals becomes arbitrarily small.