This definition stands on its own, but most textbooks require f to be measurable to be "integrable". If f isn't measurable, then we have to take extra steps to make sure the regions of X, where f is positive and negative, are measurable sets in X. Otherwise we can't integrate each piece separately, and the definition falls apart. So let's follow the crowd, and assume f is measurable, which is a prerequisite for integrable.
Let f+ equal f whenever f is positive, and 0 elsewhere. To prove this is measurable, we need our usual assumption about the topology of R. The open ray, starting at 0 and going up, is measurable, and so is its preimage under f. This is the part of X that maps into positive reals or +∞. Combine this with 0 on the rest of X and find a measurable function by concatenation. Similarly, f- = -f where f was negative, and 0 otherwise. This too is measurable by concatenation. Finally, f0 = f where f is 0, and 0 otherwise; but this is the same as 0.
Note that f = f+-f-. Also, |f| = f++f-.
Let L(X,σ,μ) denote the measurable functions from X into the extended reals, such that ∫ f+ and ∫ f- are finite. These functions are all integrable by definition, and the integral is as follows.
∫ f = ∫ f+ - ∫ f-
Note that the integral of an integrable function is finite.
If f meets both criteria simultaneously, i.e. nonnegative, and measurable, and its positive and negative portions have finite integrals, then the integral of f is, well, the integral of f. Where there is overlap, this definition is consistent with the one we established earlier, and there is no ambiguity.
A finite set of functions partitions X into a finite number of regions, such that each function, on a given region, is positive, negative, or 0. Within each region, the integral of the linear combination of the sign-adjusted functions is the linear combination of the integrals. Put this all together, managing the signs properly, and integration is a linear operator, as we expect.