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