Are $|X|$ and $\operatorname{sgn}(X)$ independent? Let $X$ be a real valued random variable.
Let $\operatorname{sgn}(x)$ be $1$ when $x>0$, $-1$ when $x<0$ and $0$ when $x=0$.
Why  are $|X|$ and $\operatorname{sgn}(X)$ independent, when the density function of $X$ is symmetric with respect to $0$?
Are $|X|$ and $\operatorname{sgn}(X)$ independent, when the density function of $X$ is not necessarily symmetric with respect to $0$?
Thanks!

If $X$ is a continuous random variables (absolutely continuous with respect to Lebesgue),
$$P(|X| \leq x|sgn(X)=1) = P(|X| \leq x|X > 0) = \frac{P(0 < X \leq x)}{P(X > 0)} = 
\frac{\int_{0}^{x}{f(x)dx}}{\int_{0}^{\infty}f(x)dx}$$
$$P(|X| \leq x|sgn(X)=-1) = P(|X| \leq x|X < 0) = \frac{P(-x \leq X < 0)}{P(X < 0)} = 
\frac{\int_{-x}^{0}{f(x)dx}}{\int_{-\infty}^{0}f(x)dx}$$
and $P(sgn(X)=0)$. If $f(x)$ is symmetric with respect to $0$, observe that $P(|X| \leq x|sgn(X)=1) = P(|X| \leq x|sgn(X)=-1)$ for any $x \geq 0$. Hence, $|X|$ is independent of sgn(x).
Now consider $X$ to be uniform in $(-1,2)$. Observe that $P(sgn(X)=1)=2/3$ and $P(sgn(X)=1||X|>1)=1$. Hence, $|X|$ and $sgn(X)$ are not independent.
Also observe that it was important for $X$ to be continuous. For example, consider $X $ uniform in $\{-1,0,1\}$. Its mass function is symmetric with respect to $0$ but $P(sgn(X)=0) = 1/3$ and $P(sgn(X)=0||X|=0)=1$ and, thus sgn(X) and |X| are not independent.
