$\sigma$-algebra generated by subsets of $\mathbb{R}$, and measurable functions Let $A$ be the $\sigma$-algebra of subsets of $\mathbb{R}$ generated by the intervals $(-1,0), (1,2)$ and $(4,6)$.
I am looking for -


*

*The number of sets in $A$.

*A function on $\mathbb{R}$ that is not measurable with respect to $A$.


1.
Well for each of the sets in $A$, we have that their complement must be in A so that means $(-1,0)^c, (1,2)^c$ and $(4,6)^c$ are in $A$.
The empty set must be in $A$.
All countable unions of $(-1,0), (1,2), (4,6), (-1,0)^c, (1,2)^c, (4,6)^c$ will be in $A$, although some of these unions will equal $\mathbb{R}$ so we don't want to count them multiple times.
Is there a better, more formulaic, way of determining the number of sets in a $\sigma$-alegbra generated by a number of subsets (3 in this case)?
2.
Consider the function $f(x) = x$
Now, for every $\lambda \in \mathbb{R}$ we must have that the set $S = \{x \mid f(x) > \lambda\}$ is in the $\sigma$-algebra $A$.
Well if we consider $\lambda = 0$ we have that $S = (0, \infty)$ and this set is not in $A$.
So $f(x) = x $ is a function that is not measurable with respect to $A$?
 A: Because we have only finitely many generating sets, finitary operations suffice and the $\sigma$-algebra generated by the sets is simply the algebra generated by the sets under the operations of finite unions, finite intersections, and complementation.
Your three sets (call them $S_1$, $S_2$, and $S_3$) are pairwise disjoint and their union is not all of $\mathbb{R}$, so if we define $S_4 = \mathbb{R} \setminus (S_1 \cup S_2 \cup S_3)$ then we have a partition $\{S_1,S_2,S_3,S_4\}$ of $\mathbb{R}$.
The algebra generated by $\{S_1,S_2,S_3\}$ contains $S_4$, so it is the same as the algebra generated by $\{S_1,S_2,S_3,S_4\}$.  However, thinking of the algebra as being generated by a partition will help us count the number of sets it contains.
In general, an algebra $\mathcal{A}$ on a set generated by an $n$-element partition $\{S_1,\ldots,S_n\}$ of that set will have $2^n$ elements. This is because mapping a subset (e.g. $\{S_1,S_3,S_4\}$) of the generating set to the union of that subset (e.g. $S_1 \cup S_3 \cup S_4$) gives a bijection $\mathcal{P}(S_1,\ldots,S_n) \to \mathcal{A}$.
Therefore in your case the number of sets generated is $2^4$.
For (2) your answer is correct assuming that the question is asking about measurable functions $(\mathbb{R},\mathcal{A}) \to (\mathbb{R},\mathcal{B})$ where $\mathcal{B}$ denotes the Borel $\sigma$-algebra.  It seems likely to me that the question is instead asking about measurable functions $(\mathbb{R},\mathcal{A}) \to (\mathbb{R},\mathcal{A})$, in which case the identity function would be measurable.  (Note the abuse of terminology here; the actual functions are the same in both interpretations, but measurability depends on which $\sigma$-algebras we put on the domain and co-domain.)
