measurable function
A measurable function is one compatible with the machinery of measurement: whenever you ask “for which inputs does the output land in this region?”, the answer is a set you are allowed to measure. In other words, the function never pulls a nice target set back to an unmeasurable mess. This compatibility is exactly the condition needed to integrate the function.
Formally, let (X, A) and (Y, B) be measurable spaces. A function f from X to Y is measurable if the preimage of every set in B lies in A: for all B in B, f-inverse(B) belongs to A. For real-valued functions one takes B to be the Borel sigma-algebra, and a convenient equivalent test is that {x : f(x) greater than a} is measurable for every real a. Continuous functions on R are automatically Borel measurable.
Measurability is a far weaker requirement than continuity — wildly discontinuous functions can still be measurable — yet it is robust under the operations of analysis: sums, products, suprema, infima, limsup, liminf, and pointwise limits of measurable functions are again measurable. This closure under pointwise limits, which continuity badly lacks, is what makes measurable functions the right class for integration and limit theorems.
The characteristic function of any measurable set E (1 on E, 0 off E) is measurable, since {x : 1_E(x) greater than a} is one of empty set, E, or all of X depending on a. Likewise the limit of a pointwise-convergent sequence of measurable functions is measurable.
Measurable functions are closed under pointwise limits — unlike continuous ones.
The everyday slogan “preimages of measurable sets are measurable” mirrors the topological definition of continuity (“preimages of open sets are open”). Measurability is to sigma-algebras what continuity is to topologies.