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.