I have been told: "In general, we will assume $\mathbb E[\epsilon_i|x_i]=0$. However, if by definition, $\epsilon_i= y_i - \mathbb E[y_i|x_i]$, then, $\mathbb E[\epsilon_i|x_i] = \mathbb E\big[y_i - \mathbb E[y_i|x_i]\big|x_i\big] = \mathbb E[y_i|x_i] - \mathbb E[y_i|x_i] = 0$. So $\mathbb E[\epsilon_i|x_i] =0$."
My question is how do you go from $\mathbb E\big[y_i - \mathbb E[y_i|x_i]\big|x_i\big]$ to $\mathbb E[y_i|x_i] - \mathbb E[y_i|x_i]$?
I am guessing to use the law of iterated expectations; however, I am not sure how to apply it exactly.
It's the linearity of expectation. $E[X - Y] = E[X] - E[Y]$
In your case $\mathbb E\big[y_i - \mathbb E[y_i|x_i]\big|x_i\big]$ = $\mathbb E[y_i|x_i] - \mathbb E[\mathbb E[(y_i|x_i)]|x_i] = \mathbb E[y_i|x_i] - \mathbb E[y_i|x_i]$