If the discontinuity occurs at, say, x = p, then integrate from a to p-eps, and add to the integral from p+eps to b, where a < p, b > p and eps is very small. If possible, do the integration symbolically, then take the limits of the results as eps tends to zero.
Incidentally, your f(x) example is continuous at x = 1: plot it to see!