If $\mathcal{S}=\{\emptyset, X\}$ the only $\mathcal{S}$-measurable functions from $X\to\mathbb{R}$ are the constant functions

borel-setsmeasurable-functionsmeasure-theoryreal-analysissolution-verification

I have proved the following statement and I would like to know if there are any gaps in my reasoning, thank you:

"Suppose $(X,\mathcal{S})$ is a measurable space (i.e. $X$ is a set and $\mathcal{S}$ is a $\sigma$-algebra on $X$).

We say that a function $f:X\to\mathbb{R}$ is $\mathcal{S}$-measurable if $f^{-1}(B)\in\mathcal{S}$ for every Borel set $B\subset\mathbb{R}$."

If $\mathcal{S}=\{\emptyset, X\}$ then the only $\mathcal{S}$-measurable functions from $X\to\mathbb{R}$ are the constant functions".

My proof:

Let $X$ be a set and $f:X\to\mathbb{R}$ be a non-constant measurable function: then there will be $y_1,y_2\in\mathbb{R}, y_1\neq y_2$ such that $y_1, y_2\in f(X)$ (and there will also be $x_1,x_2\in X, x_1\neq x_2$ such that $f(x_1)=y_1$ and $f(x_2)=y_2$). Now, $f^{-1}( \{y_1\} )=\mathcal{B_1}$ and $f^{-1}(\{y_2\})=\mathcal{B_2}$, where $\mathcal{B_1}$ and $\mathcal{B_2}$ are Borel sets.
There are four possible cases: either $\mathcal{B_1}=\mathcal{B_2}=\emptyset$, only one of them is $\emptyset$ and the other one is $X$ or $\mathcal{B_1}=\mathcal{B_2}=X$.

Suppose that one of $\mathcal{B_1}$ or $\mathcal{B_2}$, say $\mathcal{B_1}$, were the empty set: then $x_1\in\mathcal{B_1}=\emptyset$, a contradiction: thus the first three cases are impossible.

Suppose now that $\mathcal{B_1}=\mathcal{B_2}=\emptyset$: then $f(x_1)=f(x_2)=X$ so $y_1=y_2$, a contradiction.

Thus $f:X\to\mathbb{R}$ cannot be non-constant.

If it were constant instead, $f:X\to\mathbb{R}, f(x)=c$ for every $x\in X$ then $f^{-1}(B)=X\in\mathbb{S}$ for every Borel set containing $c$ and $f^{-1}(B)=\emptyset\in\mathcal{S}$ for every Borel set which does not contain $c$ thus $f^{-1}(B)\in\mathcal{S}$ in every possible case.

We have thus showed that if $\mathcal{S}={\emptyset, X}$ then the only $\mathcal{S}$-measurable functions are the constant functions, as desired.

Best Answer

Your proof looks correct, but can be written much shorter. In particular, you don't need to distinguish cases.

Suppose that $f: X \to \mathbb{R}$ is $\mathcal{S}$-measurable and consider $y\in \operatorname{Im}(f)$. Then $$\{x \in X: f(x) = y\} \in \mathcal{S}$$

but since $y$ is in the image of $f$, this set is non-empty. Hence, this set must be $X$ and thus $f(x) = y$ for all $x \in X$, i.e. $f$ is contant.