Let $(\Omega, \mathcal{F}, P)$ be a probability space.
Let $X:\Omega \rightarrow \mathbb{R}$ be a $\mathcal{F}-$measurable random variable.
Prove or disprove that $\mathbb{E}[X|\sigma(X)]=X$ almost surely, where $\sigma(X)$ is a sigma algebra generated by $X$.
Here is attempt.
Let $\mathcal{G}:=\sigma(X)$.
We first to show that for all $A\in \mathcal{G}$, \begin{equation} \int_A \mathbb{E}[X|\mathcal{G}](\omega)dP(\omega) = \int_A X(\omega)dP(\omega). \end{equation} By definition of $\sigma(X)$, for any $A\in \mathcal{G}$ there exists $B\in \mathcal{B}(\mathbb{R})$ such that $X^{-1}(B)=A$, where $\mathcal{B}(\mathbb{R})$ is a Borel set. Then \begin{align} \int_A \mathbb{E}[X|\mathcal{G}](\omega)dP(\omega) &=\mathbb{E}[X|\mathcal{G}]\cdot P(A) \quad (\because \mathbb{E}[X|\mathcal{G}] \text{ is } \sigma(X)-\text{measurable, hence constant over }X^{-1}(B)=A)\\ & = \mathbb{E}[X|\mathcal{G}]\cdot \mathbb{E}[\mathbb{1}_{A}] \quad (\because P(A)=\mathbb{E}[\mathbb{1}_{A}])\\ & = \mathbb{E}[\mathbb{1}_{A}\cdot \mathbb{E}[X|\mathcal{G}]] \quad (\text{again, } \mathbb{E}[X|\mathcal{G}] \text{ is constant over }A)\\ & = \mathbb{E}[\mathbb{E}[X\cdot \mathbb{1}_{A}|\mathcal{G}]] \quad (\because \mathbb{1}_{A} \text{ is } \mathcal{G}-\text{measurable} )\\ & = \mathbb{E}[X\cdot \mathbb{1}_A] \quad (\text{by Iterated Law of Expectation} )\\ & = \int_A X(\omega)dP(\omega). \end{align} Next step is to show that $\mathbb{E}[X|\mathcal{G}]=X$ almost surely. But I am stuck at this step.
How can I come to a conclusion? Also, could anybody verify that the steps so far are indeed true?
Definition $\mathbb{E}[X\,|\,\mathcal G] = Y$ means:
(a) $Y$ is $\mathcal{G}$-measurable and
(b) for all $A \in \mathcal G$, $\mathbb{E}[X\;\mathbf1_A]=\mathbb{E}[Y\;\mathbf1_A]$.
Check that this is true when $Y=X$ and $\mathcal G = \sigma(X)$.