I am intuitively convinced that $E[f(X)] = f(X)$, if $f$ is deterministic, but I cannot derive it using the integral definition of expectation. Assuming $X \sim unif(0,1)$ I get: $$ E[f(X)] = \int^{1}_{0}{f(x)p(x)dx} = \int^{1}_{0}{f(x)dx} = \overline{f} $$ which is not necessarily $f$.
Appreciate any help!
Edit: Thank you all, I made a mess with the notations, and somehow my question is not a question anymore
If $X$ is a random variable, so is $f(X)$. Unless $f$ is a degenerate function (i.e. $f(x) = const$), it is not meaningful to compare $\mathbb{E}[f(X)]$ (which is simply a number, if it exists) to $f(X)$, which is a random variable.