When are these functions of a random variable independent? Assume that $I$ is an indicator variable
\begin{equation}
I=\begin{cases} 1 &, \text{if} \,X<0 \\ 0 &, \text{else}\end{cases}
\end{equation}
and $X$ is a random variable. I want to know if $I$ and $X^2$ are independent. I suppose this is the case but I am not sure.
 A: This post will prove:

The random variables $I(X\lt 0)$ and $X^2$ are independent if and only if either $I$ is constant (that is, $X$ almost surely always has the same sign) or there exists a positive number $\lambda$ for which $\Pr(0 \lt -X \le x) = \lambda \Pr(0 \lt X \le x)$ for all positive numbers $x$ and $\Pr(X=0)=0.$

The only symmetric random variables satisfying these conditions are those for which $\Pr(X=0)$ and $\lambda=1.$
Analysis
Probability questions can be tricky, so a good place to begin any analysis is with the definitions and characterizations of independence.  In this case, a good characterization is this: a bivariate random variable $(Y,I)$ is independent if and only if the conditional probabilities $\Pr(Y\mid I)$ do not vary with $I$ (almost surely).  We need to unravel the implications.
Writing $Y=X^2,$ compute the conditional probabilities using the elementary formulas for the discrete variable $I.$  This comes down to conditioning on the events $I=0$ and $I=1,$ because those are the only values $I$ can have.  Moreoever, since $Y \ge 0,$ we only need to check events of the form $Y\le y$ for nonnegative numbers $y\ge 0,$ which means $y$ has a square root $x$ for which $y=x^2.$  The idea is to relate the conditional probabilities to facts about $X.$  That leads us to a calculation of this sort:
$$\begin{aligned}
\Pr\left(Y\le y\mid I=1\right) &= \Pr\left(Y\le x^2\mid I=1\right)\\
&= \frac{\Pr\left(Y\le x^2\text{ and } I=1\right)}{\Pr(I=1)} \\
&= \frac{\Pr\left(X^2\le x^2\text{ and } X \lt 0\right)}{\Pr(X \lt 0)}  \\
&=  \frac{\Pr\left(-x \le X \lt 0\right)}{\Pr(X \lt 0)}.
\end{aligned}$$
For this fraction to make sense, we must suppose $\Pr(X\lt 0)\gt 0:$ that is, $X$ must have some nonzero chance of being negative.
A similar calculation (I leave the details to you) to condition on $I=0$ gives
$$\Pr(Y\le x^2\mid I=0) = \frac{\Pr(0 \le X \le x)}{\Pr(X \ge 0)}.$$
Again, we must assume $\Pr(X\ge 0)\gt 0:$ $X$ has some chance of being positive.
Equating these two conditional probabilities is equivalent to the independence of $(X^2,I).$  For convenience, set
$$\lambda = \frac{\Pr(X\lt 0)}{\Pr(X \ge 0)}$$
(the odds that $X$ is negative) to express the equality of the conditional probabilities as
$$\Pr(-x \le X \lt 0) = \lambda \Pr(0 \le X \le x).\tag{*}$$
Assuming $X$ is not entirely positive or negative, independence is equivalent to this equation holding for all $x \ge 0.$
What are the implications?
First, this result for the case $x=0$ shows
$$0 = \Pr(-0 \lt X \lt 0) = \lambda \Pr(0 \le X \le 0) = \lambda \Pr(X=0),$$
from which we deduce that $X$ has no chance of being $0.$
Aside
This immediately gives counterexamples to the intuitive conclusion that $(I,Y)$ is independent when $X$ has a symmetric distribution: simply choose a symmetric distribution that has positive probability of being $0.$
(One example of such an $X$ is the payoff after two fair bets on a fair coin: when each bet is $a,$ the total payoff has a $1/4$ chance of being $2a$ (both bets were won), $1/4$ chance of being $-2a$ (both bets were lost), and $1/2$ chance of being $0$ (one bet was won and the other was lost).

*

*When $I=1$ we know both bets were lost, whence $\Pr(X^2=a^2 \mid I=1)=1.$


*But when $I=0$ all we know is that at least one bet was won.  In only one third of those cases were both bets won, whence $\Pr(X^2 = a^2\mid I=0) = 1/3$ and $\Pr(X^2 = 0\mid I=0) = 2/3.$
Since the probability distributions of $X^2$ depend on the value of $I,$ $X^2$ and $I$ are not independent for this symmetric randomm variable $X.$)
Resumption of the analysis
Next, assuming $\Pr(X=0) = 0,$ write the independence condition $(*)$ as
$$\begin{aligned}
\Pr(0 \lt -X \le x) &= \Pr(-x \le X \lt 0) = \lambda(\Pr(X=0) + \Pr(0 \lt X \le x)) \\
&= \lambda \Pr(0 \lt X \le x).\end{aligned}\tag{**}$$
This expresses a kind of "proportional symmetry:" the distribution of $X$ for negative values is a positive multiple of the distribution of $X$ for positive values.  Here's an example:

Geometrically, a "proportionally symmetric" probability density function (pdf) is scaled by a constant amount when its positive side is reflected around the vertical axis.  In this figure, the amount is $\lambda=1/2:$ when $x \gt 0,$ all corresponding heights on the graph for values $-x$ are half the heights for $+x.$
To complete the analysis of all the possibilities, whenever $X$ is entirely negative or entirely non-negative (the two conditions excluded in the calculations), $I$ has a constant value and so $(I,Y)$ is trivially independent.
A: Not necessarily. It would depend on the distribution of $X$. If $X$ is symmetric about $0$ they would be independent. Otherwise they wouldn't.
