by conditional expectation:
$$E(h(X)\varepsilon) = E(h(X) E(\varepsilon|X)) = E(h(X)0) = 0,$$
i.e. $h(X)$ and $\varepsilon$ are uncorrelated.
To shed some light on the first part of the theorem in the satement, note that one can always write $Y=E(Y|X) + \varepsilon$, where $\varepsilon = Y-E(Y|X)$ yielding $E(\varepsilon|X)=0$, since $$E(Y|X) = E(Y|X) + E(\varepsilon|X) \quad \Rightarrow \quad E(\varepsilon|X)=0.$$
However, this is pretty boring since it doesn't give you any helpful information about the relationship of $Y$ and $X$. In order to model the relationship you will assume $Y=g(X) + \varepsilon$ for some specific $g(X)$. For this specific model to be meaningful (as in $g(X) = E(Y|X)$) you then need to assume $E(\varepsilon|X)=0$:
For a model of the form $Y=g(X)+\varepsilon$ we have $$E(\varepsilon|X) = 0 \Leftrightarrow g(X)=E(Y|X).$$
Indeed, If $E(\varepsilon|X)=0$ then $$E(Y|X)=E(g(X)|X)+E(\varepsilon|X)= g(X).$$
On the other hand, if $g(X)=E(Y|X)$ then $Y=E(Y|X) + \varepsilon$ and we have $$E(Y|X) = E(Y|X) + E(\varepsilon|X) \quad \Rightarrow \quad E(\varepsilon|X)=0.$$