Why are $X \sim U(-1,1)$ and $Y=X^2$ dependent? Suppose we have two continuous random variables $X \sim U(-1,1)$ and $Y=X^2$. I don't understand why they are dependent.
$$E[X] = 0$$
$$E[Y] = \int_{-1}^{1} x^2  dx = 2/3$$
$$E[XY] = \int_{-1}^{1} x^3 dx = 0$$
They are independent to me because $E[XY]=E[X]E[Y]$, so why they are dependent?

Let me write this in a generic manner:
Two random variables for which the expectation of the product is equal to the product of expectations need not be independent.
Let $X\sim \mathcal U(-a, a) $ where $a\in\mathbb R_+$ and let $Y\sim X^2.$ Then as noted $$ \mathbb E[XY]=\mathbb E[X^3] =0=\mathbb E[X]\mathbb E[Y].$$ But they are definitely not independent.

Reference:
$\rm [I]$ Counterexamples in Probability and Statistics, Joseph P. Romano, Andrew F. Siegel, Wadsworth, $1986, $ ex. $4.15.$
