Two questions about conditional expectation If $E[X|Y=y]=y$, does $E[X]=E[Y]$? Similarly, if $E[X|Y=y]=y^2$, does $E[X]=E[Y^2]$?
I'm having some trouble with this conditional expectation concept, although it seems intuitively true
 A: We assume that $X$ is integrable and $Y$ is square integrable. The notation $E[X\mid Y=y]=g(y)$ means that $E[X\mid Y]=g(Y)$ (Doob's theorem ensures us it's possible, since $E[X\mid Y]$ is $\sigma(Y)$-measurable. 
If $E[X\mid Y=y]=g(y)$, since $\Omega\in\sigma(Y)$, we have 
$$E[X]=\int_{\Omega}E[X\mid Y]\mathrm{d}\mathbb P=\int_{\Omega}g(Y)\mathrm{d}\mathbb P=E[g(Y)],$$
and applying it to $g(x)=x$ and $g(x)=x^2$, we get your results.
A: Yes, you’re right. Davide gave you a precise and quick answer, I’ll try to elaborate a little bit (edit: when I started, Davide just wrote a comment, his answer was written a moment later).
First, to better understand the conditional expectation concept, you may think to this situation as follows : we first draw the value y of Y, following the law of Y, and then the value x of X, using a law for X which depends on which y was drawn. 
I will use discrete notations but for the general case you can just replace everything by fancy integrals. The law of X, given Y = y, the law used to draw a value of X knowing that Y = y, is denoted $P(X = x\ |\ Y = y)$. The conditional expectation $E(X \ |\ Y=y)$ is of course $\sum_x P(X = x\ |\ Y = y)$. 
Now turn to the law of X: $P(X = x) = \sum_y P(X=x\ |\ Y=y) P(Y=y)$ (this is simply the formula of total probability). The expectation of X is then
$$E(X) = \sum_x x P(X = x) = \sum_x x \left(\sum_y P(X = x\ |\ Y=y) P(Y=y)\right)$$
$${} = \sum_y \left( \sum_x x P(X=x\ |\ Y= y) \right) P(Y=y) = \sum_y E(X\ |\ Y =y) P(Y=y).$$
I hope that this makes the sense of this formula clear.
Know denote $E(X | Y=y) = f(y)$. Then $E(X) =\sum_y f(y) P(Y = y) = E\bigl( f(Y) \bigr)$, which answers your question. 
HTH
