Artificial intelligent assistant

Independency of X,Y given that $X^2$, $Y^2$ are independent. Let $X$, $Y$ be random variables with positive probability density on every real number $x$. ($pdf_X(x)>0$, $pdf_Y(x)>0$ for every real $x$) If $X^2$ and $Y^2$ are idependent, is $X$ and $Y$ also independent? I found a counter-example, but it did not satisfied the positive pdf condition. I'm not sure whether it is true or not.

Let $W$ be a fair coin flip, and let $Z_1$ and $Z_2$ be independent standard normal random variables.

If $W$ is heads, let $X=|Z_1|$ and $Y=|Z_2|$. Otherwise if $W$ is tails, let $X=-|Z_1|$ and $Y=-|Z_2|$.

Then $X^2=Z_1^2$ and $Y^2=Z_2^2$ are independent because $Z_1$ and $Z_2$ are. However, $X$ and $Y$ have the same sign, so they are not independent.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 027ee70428e0b5bc8dd54b4b4f954aba