# If $X$ and $f(X)$ are independent, then $f(X)$ is almost surely constant

Reading some exam material, I found this property:

Let $f :\mathbb{R}\rightarrow\mathbb{R}$ a measurable function. If $X$ and $f(X)$ are independent, then $f(X)$ is almost surely constant.

Most of the properties come with a proof, but this one doesn't. So I assume that it's trivial, but I just can't see it. Any thoughts?

-
"$f$ is almost surely constant" doesn't make sense. You mean $f(X)$ is almost surely constant. – Robert Israel Jan 28 '13 at 19:25
Thank you for spotting that. – Bogdan Mihai Jan 28 '13 at 19:29

Let $A$ be the event $f(X) \le a$. Then $A$ is independent of itself (if random variables $Y$ and $Z$ are independent, then the events $Y \in B$ and $Z \in C$ are independent, for any measurable sets $B$ and $C$). Now what can you say about an event that is independent of itself?
Or possibly zero. Solutions to $x^2=x$. – copper.hat Jan 28 '13 at 19:35
I get now why this implies that there is only one a such that $f(X) \le a$. But why is A independent of itself? – Bogdan Mihai Jan 28 '13 at 19:39
I mean $f(X) = a$. – Bogdan Mihai Jan 28 '13 at 19:45
Let $B=\{\omega | f(X(\omega)) \in (\infty,a]\}$ and $C = (\infty,a]$. Then $X \in B$ and $F(X) \in C$ are the same event, but by assumption of independence, $p(B \cap C) = pB pC$, or equivalently, $pB = (p B)^2$. – copper.hat Jan 28 '13 at 19:51