Any nice pedagogical examples of S-measurable functions? (I'm currently studying from Axler's book, http://measure.axler.net/MIRA.pdf, in case his terminology is non-standard). For the simplest $\sigma$-algebra on $X$: $\mathcal S = \{\varnothing, X\}$, the only $\mathcal S$-measurable functions are the constant functions. For $\mathcal S = \{\varnothing, A, (X\setminus A), X\}$, the only $\mathcal S$-measurable functions are the ones that are constant on $A$ and constant on $X\setminus A$. All in all, these are really boring functions. 
Of course, jumping directly to Borel measurability gives us more interesting functions, but I'm wondering if there are nice interesting examples to help teach the idea of just $\mathcal S$-measurable functions. 
If you were teaching $\mathcal S$-measurability for example, would you give some explicit examples, or would you just say "OK, this idea is really only important because I'm now going to introduce Borel measurability"?
 A: Some further examples which might be interesting to look at:


*

*Let $X \neq \emptyset$ be some set and $(A_j)_{j \in \mathbb{N}}$ a partition of $X$, i.e. the sets are pairwise disjoint and $\bigcup_{j \geq 1} A_j = X$. Consider $$\mathcal{S} := \sigma(A_j; j \geq 1).$$ A (real-valued) function $f$ is $\mathcal{S}$-measurable if, and only if, it is of the form $$f(x) = \sum_{j \geq 1} c_j 1_{A_j}(x).$$ This generalizes the "trivial" example which you mentioned in your question.

*Let $X \neq \emptyset$ be uncountable and consider the co-countable $\sigma$-algebra $$\mathcal{S} := \{A \subset X; \text{$A$ or $X \setminus A$ is countable}\}.$$ A (real-valued) function $f$ is $\mathcal{S}$-measurable if, and only if, it is constant up to countably many points.

*Let $X \neq \emptyset$ and $g: X \to \mathbb{R}$ some mapping. Denote by $$\sigma(g):= \{g^{-1}(B); B \in \mathcal{B}(\mathbb{R})\}$$ the smallest $\sigma$-algebra on $X$ such that $g:X \to \mathbb{R}$ is measurable. A function $f: X \to \mathbb{R}$ is $\sigma(g)$-measurable if, and only if, it can be written in the form $f(x)=h(g(x))$, $x \in X$, for some measurable mapping $h:\mathbb{R} \to \mathbb{R}$. This result is known as factorization lemma.


The first and third example appear lateron in probability theory, while studying conditional expectations and conditional probabilities. 
