Conditional Expectation given X is measurable wrt to sigma field If $X$ is $\mathcal{G}$-measurable, then $E(X|\mathcal{G})=X$. I don't understand this. Since $X$ is a random variable, it is measurable to any sub $\sigma$-field of $\mathcal{F}$. Wouldn't the above equation always hold? When is $X$ NOT $\mathcal{G}$-measurable?
The proof for this is: for every $G \in \mathcal{G}$, $\int_{G} X dP = \int_{G} X dP$. I don't understand what $X$ being $\mathcal{G}$ measurable has to to with the proof. 
 A: The conditional expectation $E(X|\mathcal G)$ is a random variable determined (up to sets of probability $0$) by two properties: (i) $E(X|\mathcal G)$ is $\mathcal G$-measurable, and (ii) for each $\mathcal G$-measurable set $B$, the integral of $E(X|\mathcal G)$ over $B$ is equal to the integral of $X$ over $B$. If $X$ is itself $\mathcal G$-measurable, then it has these two properties, and so it must be $E(X|\mathcal G)$. 
A: $X$ is $\mathcal{G}$-measurable if and only if for any borel set $A$, the event $\{X\in A\}$ belongs to $\mathcal{G}$.
Now if $X$ is a random variable, $X$ is $\mathcal{F}$-measurable, by definition, so that $\{X\in A\}\in\mathcal{F}$. But if $\mathcal{G}\subset\mathcal{F}$, you can have $\{X\in A\}\in\mathcal{F}$ and $\{X\in A\}\not\in\mathcal{G}$.
For example, consider $X$ a Bernoulli random variable, with parameter $p\in(0,1)$ and $\mathcal{G}=\{\emptyset,\Omega\}$. Then $\mathcal{G}$ is a $\sigma$-algebra and $X$ is NOT $\mathcal{G}$-measurable. Indeed, $X^{-1}(\{0\})\neq\emptyset$ and $X^{-1}(\{0\})\neq\Omega$.
More generally, the smaller the $\sigma$-algebra on $\Omega$, the harder it is to be measurable.
A: If X is $\mathcal{G}$  measurable then $\mathcal{G}$  has all the information about X.
If we condition the expected value of X on something which gives us all the information about X, then the expected value of X is going to be X itself.
E[X|X] = X; we already know X so that's what we expect. Also note that $E[X|X] $ is shorthand for $E[X|\sigma(X)] $
To justify why $\mathcal{G}$  has all the information about X.
Let ($\Omega$, $\mathcal{F}$ , $\mathbb{P}$) be a probability space and let $X: \Omega \rightarrow \mathbb{R}$ be a random variable
By definition if X is $\mathcal{G}$ measurable then for any set $B \in Bor(\mathbb{R})$, $ X^{-1}(B) \in \mathcal{G}$.
That means that every interval in $\mathbb{R}$, representing any possible outcome for $X$, is mapped to an event in $\mathcal{G}$.
