halls of ivy's interesting remarks, may be enlarged on as follows.
first of all it is a basic fact of elementary integration theory, proved say in spivak's calculus on manifolds, that every bounded function f which has only a measure zero set of discontinutities, is riemann integrable.
then we can take the indefinite integral of any such function as an "antiderivative". i.e. the function G(x) = integral of f from a to x, is in some sense an "antiderivative" of f. I.e. the usual elementary proof of the fundamental theorem of calculus surely found in every calculus book, (except maybe sylvanus p thompson?), proves that G is differentiable at least at every point x where f was continuous, and at such points that G'(x) = f(x).
Moreover G is continuous everywhere.
However, it does not follow that such an "antiderivative" can be used to evaluate the integral of f. I.e. there may exist other continuous functions H which are also differentiable everywhere that f is continuous, and such that H'(x) = f(x) at such points, and yet H and G may not differ by a constant!
So the usual mean value theorem fails here for these more general functions.
So we would like to rule out allowing the latter function H be an "antiderivative" of f.
E.g. consider the famous "middle third" construction, in which we define H to equal 1/2 on the open middle third of the unit interval, to equal 1/4 on the open middle third of the interval from 0 to 1/3, and to be 3/4 on the open middle third of the interval from 2/3 to 1. Continue this construction forever, and obtain a function H which is continuous on all of [0,1], has H(0) = 0, H(1) = 1, but H has derivative zero on the union of all the middle third sets, which together have length one, by the geometric series formula.
Thus this H is an antiderivative in our naive sense above for the function f which equals zero on the union of the middle third sets and equals 1 elsewhere (elsewhere being a closed set of measure zero). However the integral of this function f is zero, while using H to compute H(1)-H(0) gives us 1.
Thus we need a morev restrictive definition of "antiderivative" if we want the concept to be useful in integrating arbitrary riemann integrabele functions. the concept needed is a strengthening of uniform continuity called "absolute continuity". i think it says more or less that given any length e, we can find a length d such that on any finite disjoint union of subintervals of total length d, the total change in the function is less than e.
Then if we define an antiderivative of a riemann integrable function f to be an absolutely continuous function G for which G'(x) = f(x) wherever f is continuous, then it does follow that any two such functions differ by a constant, and thus that the integral of f from a to b is G(b)-G(a), for anyone of them.
In trying to offer new stuff to my calculus clas this eyar I was venturing into these waters, and actually made a false conjecture about the more naive antiderivatives above, until educated by an analyst colleague. so to my great delight, i finally found out what that concept "absolute continutiy" was good for, that I encountered so long ago in measure theory!
by the way a set has measure zero if it can be covered by a sequence of intervals of arbitrarily small total length. for instance any sequence of points ahs measure zero, since given a length e, we can take a sequence of intervals of lengths e/2, e/4, e/8,... and center one interval on each point thus covering them all.
the complement of the middle thiord set disacussed above is actually more numerous than this, but has measure zero because the complement in [0,1] has length 1. i have proved elsewhere on this site that this set is uncountable.