# $X$ and $f(X)$ independent $\Longleftrightarrow$ $f(X)$ is degenerate

Let $(\Omega, \cal{A}, \mathbb{P})$ be a probability space and $X$ a random variable on $\Omega$. Let, also, $f:\Omega\to\mathbb{R}$ be a Borel function. Then:
$X$ and $f(X)$ are independent $\Longleftrightarrow$ there exists some $t\in\mathbb{R}$ such that $\mathbb{P}[f(X)=t]=1$, that is $f(X)$ is a degenerate r.v.

The only thing that I could make out is that if $X$ and $f(X)$ are independent, then
$\mathbb{P}[f(X)\in B]=0$ or $1$ for every Borel subset of $\mathbb{R}$, since $\sigma(f(X))\subseteq \sigma(X)$ and hence, $f(X)$ is independent of its self. Suppose, now, that $\mathbb{P}[f(X)\leq x]=0$ for all $x\in\mathbb{R}$. Then:
$\mathbb{P}[f(X)\in\mathbb{R}]=\mathbb{P}[\bigcup_{n=0}^{\infty}[f(X)\leq n]]\leq\sum_{n=0}^{\infty}[f(X)\leq n]=0$ which obviously is a contradiction since $\mathbb{P}[f(x)\in\mathbb{R}]=1$.

However, I don't know ow to prove this and my attempt isn't likely to become a complete solution.
Any help would be appreciated.

-

If the random variable $Y$ is independent of itself, then there exists $y$ such that $Y=y$ almost surely.

To prove this, consider the CDF $F_Y:x\mapsto\mathbb P(Y\leqslant x)$ and note that for every $x$ the event $[Y\leqslant x]$ is independent of itself hence $F_Y(x)$ is $0$ or $1$. Since $F_Y$ has limits $0$ at $-\infty$ and $1$ at $+\infty$, the real number $y=\inf\{x\mid F_Y(x)=1\}$ is well defined and finite.

Since $F_Y$ is nondecreasing, $F(x)=0$ for every $x\lt y$ and $F_Y(x)=1$ for every $x\gt y$, hence $\mathbb P(y-u\lt Y\leqslant y+u)=1$ for every $u\gt0$, in particular, $\mathbb P(Y=y)=1$.

-

There is another proof of this fact, which follows immediately from the fact that you proved: $\Bbb P[f(x)\in B]\in \{0,1\}$ and reminds the Nested Intervals Theorem. For the shorthand let $$\mu(B):=\Bbb P[f(X)\in B]$$ denote the distribution of $f(X)$.

So we have $\mu \in \{0,1\}$ and $\mu(\Bbb R) = 1$. Let us prove that it implies that $\mu$ is a degenerate distribution, i.e. there exists $x\in \Bbb R$ such that $\mu(\{x\}) = 1$.

1. There exists a bounded closed interval $I_n =[-n,n]$ such that $\mu(I_n) = 1$. Indeed, if there is no such interval then $$1 = \mu(\Bbb R) = \mu\left(\bigcup_n I_n\right) = \lim_n \mu(I_n) = 0$$ which is a contradiction.

2. Now we construct a sequence of nested intervals. Denote $J_0 = I_n$, and let $$J_0^{-} = [-n,0],\quad J_0^+ = [0,n].$$ There is at least one of these intervals of measure $1$. Denote it by $J_1$.

3. Repeat by induction the procedure for $J_k$ where $k = 1,2,\dots$: divide it symmetrically into two parts and put $J_{k+1}$ be any of these parts such that $\mu(J_{k+1}) = 1$.

4. In the end, you have a decreasing sequence of compact intervals $J_0,\dots,J_k,\dots$ such that $\mathrm{diam}(J_k)\leq 2^{1-k}n$ thus $\bigcap_k J_k$ is some single point. We have $$\mu\left(\bigcap_k J_k\right) = \lim_k \mu(J_k) = 1$$ so that we found $x = \bigcap_k J_k$.

-