Let x be a set. A sigma algebra on X, sometimes denoted σ, is a collection of subsets of X such that:
(The term algebra is somewhat unfortunate, since this has nothing to do with rings.)
We call the pair (X,σ) a "measurable space", similar to a topological space. If A is in σ, we say A is "measurable", or a "measurable set", analogous to an open set.
From (1) and (2), it follows that the empty set is in σ.
Using Demorgan's law, one can show that the countable intersection of sets in σ also lies in σ.
Note that σ could be X and the empty set. This is the indiscrete algebra, similar to the indiscrete topology. At the other extreme, σ could contain every subset of X. This is the discrete algebra, similar to the discrete topology.
One sigma algebra may be stronger than another, if it includes more subsets of X. Thus algebras can be partially ordered, just as topologies on X are partially ordered. Note that the intersection of algebras on X produces another valid algebra. Thus we may talk about the weakest algebra on X that contains a given collection C of sets within X. It is the intersection of all algebras that contain C. There is at least one such algebra, namely the discrete algebra on X, thus the "generated algebra" makes sense, and is denoted σ[C]. We might think of C as a base for σ.
If C, in the above paragraph, is itself a topology on X, then σ[C] is a Borel sigma algebra. This will become clearer later on.
Closed intervals include points, i.e. the degenerate closed intervals, and thus the endpoints of any closed interval lie in σ. Remove these to get the open intervals, as described above.
Half open intervals pointing up can be used to converge on any given point z. Thus the endpoints of these half open intervals are in σ, and can be removed to give open intervals. A similar result holds for half open intervals pointing down.
Closed intervals can be combined to produce closed rays pointing up and down, and two such rays intersect in a closed interval. Similarly, open intervals combine to produce open rays extending up and down, and open rays overlap in open intervals.
In summary, the following sets imply the same sigma algebra on the reals. Open intervals, closed intervals, half open intervals pointing up, half open intervals pointing down, closed rays, and open rays.
In contrast, start with the points of R, and produce a σ algebra. Note that σ must contain every countable collection of points, and the complements thereof. Show that these sets satisfy the criteria of a sigma algebra. Now, the countable union of points cannot create a closed interval, hence this is a weaker algebra on the reals.
The composition of measurable functions, from X to Y to Z, is measurable from X to Z.
The identity map on X is measurable, for every σ on X.
Any function from a discrete space, or into an indiscrete space, is measurable.
Assume each set in C has a measurable preimage under f. Each measurable set in Y is constructed by taking the union or complement of preexisting measurable sets. Proceed by induction on the number of steps in the construction of our measurable set. When n = 1, we have the assertion "belongs to C", and the preimage is measurable by assumption. If T is measurable in Y, with measurable preimage S in X, take complements, and the preimage of the complement of T is the complement of S. Both these sets are measurable, by the properties of a sigma algebra. Similarly, the countable union of measurable preimages produces a measurable set in X - and that completes the proof.
As you move to the sum of two measurable functions f+g, beware of the topology trap. In topology, we considered an arbitrary point x in the preimage of a given base open set, then surrounded x with an open neighborhood that maps into our open set. The preimage is the union of these open neighborhoods, and is open. But that assumes the arbitrary union of open sets is open. In a sigma algebra, unions must be countable. We have a little more work to do.
Start with a closed interval [a,b], and graph, in the xy plane, a ≤ x+y ≤ b. This is a closed strip slanting down and to the right. Cover the strip with closed squares. This is not a partition; the squares overlap at their boundaries. The covering is fractal in nature - I'll leave the details to you. Since each square has a distinct rational point inside, the covering is countable. Now, each square implies a range of x and a range of y, i.e. two closed intervals. These pull back, through f and g respectively, to preimages that belong to #s'. Their intersection also belongs to #s'. These points in the domain put f in the proper range, and g in the proper range, as described by our square, and the square lies in our strip, so that f+g lies in [a,b]. The countable union of these preimages also lies in #s', and that covers the strip. The preimage of [a,b] is a measurable set, and f+g is measurable.
The proof for f×g works the same way. Graph a ≤ xy ≤ b, and cover the region between these two hyperbolas with squares. Similarly, a ≤ 1/x ≤ b is used to prove 1/g is measurable, provided g is nonzero. Combine this with multiplication, and f/g is measurable.
Conversely, let X be the countable union of disjoint measurable regions, and assume f is measurable on each region. The various preimages under f are measurable inside each region, and measurable in X. Take their union to find a measurable set, which is the preimage of f throughout X.
This is analogous to topology, where a function is continuous on a space iff it is continuous on the individual components.
Max(f,g) is derived in the same way. Since f-g is measurable, we can separate X into regions where f ≥ g, and f < g. Apply f and g to these regions respectively, and max(f,g) is measurable. Similarly, min(f,g) is measurable. This generalizes to any finite set of measurable functions.