Suppose $Z$ is a continuous random variable on $\mathbb{R}^n$.
$f: \mathbb{R}^n \to \mathbb{R}^+ \cup \{0\}$ is a function, such that $\mathrm{E} Z = \int_{\mathbb{R}^n} z \times f(z)dz$. Then we know $f$ is not necessarily the density function of $Z$. What else conditions can make $f$ the density function of $Z$?
For example, if for any measurable and bounded function $u: \mathbb{R}^n \to \mathbb{R}^n$, $\mathrm{E} (u(Z)) = \int_{\mathbb{R}^n} u(z) \times f(z)dz$. Then is $f$ the density function of $Z$? This is inspired from did's reply.
Thanks and regards!