Real and complex analysis Rudin. Question 6 On page 33 of Rudin's Real And Complex Analysis, question 6 asks us " let X be an uncountable set, let M be the collection of all sets E in X such that either E or E's complement is countable. Define u(E)=0 (u is a measure on M) in the first case and u(E)=1 in the second. ...
Describe the corresponding measurable functions and their integrals."
I have no idea how the integrals would be defined. I'm  pretty sure the measurable functions send uncountable sets to uncountable sets and countable sets to countable sets. So the integrals would zero? Because the preimage of any point on the real line is a countable set, and the measure of a countable set is 0??? Any help would be appreciated.
 A: So the set-up is this: Let $X$ be an uncountable set and let
$$\mathcal{M} = \{E\subseteq X:E\text{ is countable or }X\setminus E\text{ is countable}\}.$$
Let $\mu$ be a measure on $\mathcal{M}$ such that $\mu(E)=0$ if $E$ is countable and $\mu(E)=1$ is $X\setminus E$ is uncountable.
We first want to find all the measurable functions on $X$. By definition, a function $f:X\to\mathbb{R}$ is measurable if, for all $a\in\mathbb{R}$, the set $\{x\in X:f(x)>a\}$ is measurable in $X$. We'll use $\{f>a\}$ as a shorthand for that set from here on.
Claim 1: $f$ is measurable if and only if $f$ is constant except on a countable set. That is, $f$ is measurable if and only if there exists some $E\subseteq X$ such that $E$ is countable and $f$ is constant on $X\setminus E$.
Proof. The $\impliedby$ direction is more or less trivial, you should just take it as an exercise. Now, we will show the $\implies$ direction. First notice that, for all measurable $f$ and $a\in\mathbb{R}$, we either have $\{f>a\}$ is countable or $\{f\leq a\}$ is countable.
Let $f:X\to\mathbb{R}$ be a measurable function. Consider the set
$$A= \{a\in\mathbb{R}:\{f>a\}\text{ is countable}\}.$$
First, notice that $A\ne\emptyset$ because, if for all $a\in\mathbb{R}$, the set $\{f>a\}$ is uncountable, then that would imply $\{f\leq a\}$ is countable for all $a\in\mathbb{R}$ and we would have a contradiction (i.e. we would have $\{f\leq n\}$ to be countable for all $n\in\mathbb{N}$ and thus $f^{-1}(\mathbb{R})$ would be countable, which contradicts the uncountability of $X$). On the other had, also note that $A$ is bounded below by a similar argument.
Let $c=\inf A$. We claim that $f^{-1}(\mathbb{R}\setminus\{c\})$ is countable and that completes our proof. To see this, first notice that
$$\{f>c\} = \bigcup_k\left\{f>c+\frac1k\right\}$$
and hence $\{f>c\}$ is countable. On the other hand, consider
$$\{f<c\} = \bigcup_k\left\{f\leq c-\frac1k\right\}.$$
Note that each of $c-\frac1k\notin A$, hence $\left\{f>c-\frac1k\right\}$ is uncountable, which implies that $\left\{f\leq c-\frac1k\right\}$ is countable. Thus, $\{f<c\}$ is countable as well. The above two results imply that $f^{-1}(\mathbb{R}\setminus\{c\})$ is countable. QED
Now that we have characterized all the measurable functions, the integration should be relatively straightforward. Let $f$ be a measurable function and $c\in\mathbb{R}$ be such that $f^{-1}(\mathbb{R}\setminus \{c\})$ is countable (the existence of such $c$ is shown above). Then we have
$$\int_X f = \int_{f^{-1}(\{c\})}f + \int_{f^{-1}(\mathbb{R}\setminus \{c\})}f = c$$
because the set $f^{-1}(\mathbb{R}\setminus \{c\})$ has measure zero.
