Let $X$ be an integrable random variable. I want to know if it is true that $E[X|X^2] = X$.
At first I thought it is true because $X$ is measurable with respect of the $\sigma$-algebra generated by $X^2$, because $f(x) = x^2$ is a Borel measurable function. But after a while I noticed that: $$\sigma(f(X))\subset \sigma(X)$$ The proof is in this pdf document, Theorem 52.
As a consecuence, $X$ is not necesarily measurable with respect of $\sigma(f(X))$, so $E[X|X^2] = X$ is false.
I want to know if I'm wrong, or if there's is a better way to check if $E[X|X^2] = X$ is true or not.
Your explanation is fine (and Did's comment deals with the case where $X$ has a pdf)), but a counterexample may be simpler.
Take $X$ to be a Rademacher random variable, i.e. uniform on $\{-1,1\}$. Then $X^2=1$ a.s., so $\mathbb{E}[X\mid X^2] = \mathbb{E}[X] = 0 \neq X$.
As mentioned in a comment below, this generalizes to any symmetric (and non zero a.s.) random variable.