Describe measurable functions I have the following exersice:
Describe the Borel-measurable functions $f:X\to\mathbb{R}$, where $X$ has the $\sigma$-algebra of subsets $A\subseteq X$ such that $A$ is countable or $X\setminus A$ is countable.
Of course, I know this is equivalent to for each $a\in\mathbb{R}$, $f^{-1}((a,+\infty))$ is countable or $f^{-1}((-\infty,a])$ is countable.
But, is there a smarter way to describe such functions?
Thanks.
 A: *

*Assume that $X$ is countable; then each subset is countable. Therefore, any $f\colon X\to\mathbb R$ is Borel measurable. 

*Assume that $X$ is not countable and $f\colon X\to\mathbb R$ is Borel-measurable. If $a$ and $b$ are two distinct real numbers, then at least one one the sets $f^{-1}(\{a\})$ and $f^{-1}(\{b\})$ is countable. Hence there is at most one $a\in\mathbb R$ such that $f^{-1}(\{a\})$ is not countable. If such an $a$ exists, then $f^{-1}(\mathbb R\setminus \{a\})$ is countable hence $f$ has the form $$\tag{1}a\chi_A+\sum_{j=1}^\infty c_j\chi_{A_j},$$
where $A_j$ are pairwise disjoint countable sets and $X\setminus A$ is countable. Conversely each function of the form $(1)$ is Borel-measurable.
A: The measurable functions $f: \mathbb{R} \rightarrow \mathbb{R}$ are precisely the ones for which there exists an $a\in\mathbb{R}$ such that $f^{-1}(\mathbb{R}\backslash\{a\})$ is countable. Indeed, such a function is measurable because in this case $f^{-1}((-\infty, b])$ will be countable if $b<a$ and co-countable otherwise. Conversely if an $f: \mathbb{R} \rightarrow \mathbb{R}$ is measurable, consider the set $A:=\{b: f^{-1}((-\infty, b]) \text{ is co-countable}\}$. Since clearly $\mathbb{R}=\bigcup\limits_{n=1}^{\infty}f^{-1}((-\infty,n])$ we deduce that not all of the $f^{-1}((-\infty,n])$ sets can be countable, so since $f$ is measurable at least one of them is co-countable. Hence $B$ is non-empty. Similarly, $\mathbb{R}=\bigcup\limits_{k=1}^{\infty}f^{-1}((-k,\infty))$ so there is a co-countable $f^{-1}((-k,\infty))$ set, hence $f^{-1}((-k,\infty))$ is countable so the set $A$ is bounded from below by $k$. Hence $A$ has an infimum, say $a$...
