In the context of reconstruction of climate data from ice cores (see related question at MSE) I came about the following problem. (More background and motivation can be given on demand.)
Let $f:\mathbb{R}\rightarrow \mathbb{R}$ be an arbitrary smooth function, and let $p(x)$ be a probability function with $\int_{-\infty}^{\infty} p(x)\text{d}x = 1$. We can write:
$$\int_{-\infty}^{\infty} f(x)\ p(x)\ \text{d}x = f\Big( \int_{-\infty}^{\infty} x \ p(x) \ \text{d}x \Big) + \epsilon$$
My question is for the error $\epsilon$. Can there be a closed form or an estimation of lower and upper bounds in terms of $f$ and $p$? Which mathematical techniques do I have to apply?
There are some extreme cases where an exact solution is easy to obtain:
(1) $f(x) \equiv x_0$. In this case we have
$$\int_{-\infty}^{\infty} x_0\ p(x)\ \text{d}x = x_0 \int_{-\infty}^{\infty}\ p(x) \ \text{d}x = x_0$$
which yields $\epsilon = 0$.
(2) $f(x) = \alpha x$. In this case we have
$$\alpha \int_{-\infty}^{\infty} x \ p(x)\ \text{d}x = \alpha\ \int_{-\infty}^{\infty} x \ p(x) \ \text{d}x + \epsilon$$
which again yields $\epsilon = 0$.
(3) $p(x) = \delta(x)$. In this case we have for the left-hand side
$$\int_{-\infty}^{\infty} f(x)\ \delta(x)\ \text{d}x = f(0)$$
and for the right-hand side
$$f\Big(\int_{-\infty}^{\infty} x\ \delta(x)\ \text{d}x\Big) = f(0)$$
which again yields $\epsilon = 0$.
(4) [omitted]
Instead of the general case, I would also be happy with solutions for the next most simple cases:
(5) $f(x) = x^2$
(6) A normal distribution, essentially
$$p(x) = e^{-x^{2}}$$
Again: Which techniques should be applied to calculate or estimate the error $\epsilon$?