About regression model and assumptions I have the following general regression model $$y=E_{Y|X}[y|x]+u.....(1)$$ Where $u$ is understood as the error. In the basic model there is a common basic assumption about avoid endogeneity, i.e. $$E_U[u*f(x)]=0....(2)$$ Where $f(x)$ is a function of the given random variable $X$. I want to prove $(2)$ from $(1)$. I tried to use the iterated expected function but something is not working.

You have:


*

*(1) $Y = \mathsf E_{Y\mid X}(Y\mid X) + U$

*(2) $\mathsf E_U\big(U\cdot f(X)\big) = 0$


From (1) we see that $U$ is a linear combination of $X$ and $Y$. 
Then by assuming (1), the LHS of (2) ...
$$\begin{align}
\mathsf E_U\big(U\cdot f(X)\big)
 & = \mathsf E_X\Big(\mathsf E_{Y\mid X}\big(U\cdot f(X)\mid X\big)\Big) & \textsf{Law of Iterated Expectation}
\\ & = \mathsf E_X\Big(\mathsf E_{Y\mid X}\big(Y-\mathsf E_{Y\mid X}(Y\mid X)\mid X\big)\cdot f(X)\Big) & \impliedby (1)
\\ & = \mathsf E_X\Big(\big(\mathsf E_{Y\mid X}(Y\mid X)-\mathsf E_{Y\mid X}(Y\mid X)\big)\cdot f(X)\Big) & \text{Linearity of Expectation}
\\ & = 0
\end{align}$$
... implies the RHS of (2). Thus (1)$ \implies $(2) and we are done.
$\Box$
