Is E(Y|X) a function of Y? I'm slightly confused by a question I have encountered, it's a true or false question stating:
'The expression $E_{(Y|X)} (Y|X)$ is a function of $Y$.'
My automatic instinct was, well yes of course it is.
Assuming that the variables are continuous, I think formally (please correct me if I'm wrong as I'm still getting used to the notation): 
$$E_{(Y|X)} (Y|X) = \int_{-\infty}^{\infty} y \ g(y|x) \ dy$$
where
$$g(y|x) =\frac {f_{x,y}(x,y)}{\int_{-\infty}^{\infty}f_{x,y}(x,y)dy}$$
Which I think demonstrates it is a function of $Y$, however the answer was 'false'. Have I made a mistake interpreting the notation? Or is it because the expression is a function of both $Y$ and $X$, something which I was aware of however misinterpreted the question.
**On second thought I just realised I'm doing prep work for econometrics, is it because $Y$ is the dependent variable, $X$ the explanatory and therefore $ Y=\mu(X)$ for some function $\mu$.
Any guidance will be greatly appreciated.
 A: $$g_{Y\mid X = x}(y\mid x) =\frac {f_{X,Y}(x,y)}{\int_{-\infty}^{\infty}f_{X,Y}(x,y)dy} = \frac {f_{X,Y}(x,y)}{f_{X}(x)}$$ and so
$$E[Y\mid X = x] = \int_{-\infty}^{\infty} y g_{Y\mid X = x}(y\mid x) \ dy
= \frac{1}{f_{X}(x)} \int_{-\infty}^{\infty} y f_{X,Y}(x,y) \ dy = h(x)\tag{1}$$
Thus, the number $E[Y\mid X = x]$ depends on your choice of $x$.
It does not depend on $y$ at all; $y$ is just a variable of
integration and disappears when we plug in the limits on that
integral in $(1)$.
We can think of this number as the realization or sample of
a random variable $Z$ where $Z$ has value $E[Y\mid X = x]$ whenever
it so happens that $X$ has value $x$. So, we can think of the random
variable $Z = E[Y \mid X]$ as a function $h(X)$ of $X$ 
since if we sample
$X$ we can figure out what the sample of $Z$ must be.  $Z$ is not
a function of $Y$ at all!
The law of iterated expectation says that the expected value
of $Z = h(X)$, which is a function of $X$ and not at all of $Y$, quite
by magic, happens to equal $E[Y]$, the expected value of $Y$,
that is, 
$$E[Z] = E[h(X)] = E\left[\, E[Y\mid X]\,\right] = E[Y].$$
A: @Neznajka pointed out the formal basis for why $E[Y|X]$ is a function of $X$, not $Y$. At a more abstract level, you can also see this by considering that $E[Y|X]$ takes as input a value of $X$ and maps it to a conditional expected value of $Y$. Therefore, you can write $E[Y|X]$ as a plain old univariate function $f: \mathbb{R} \to \mathbb{R}, x\mapsto E[Y|X=x]$.
So, since the distribution of $Y$ remains fixed, then it has to be a function of $X$.
