# Density function of a function of random variable by expectation?

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!

-
This is explained there (but one should consider functions $u:\mathbb R^n\to\mathbb R$). – Did Jul 5 '12 at 16:55

This works since you can take indicator functions $u = \mathbb{I}_A$ for any measurable subset $A$ and see that $P(Z \in A) = \int_A f(z) dz$.
Did you mean for $u$ to map into $\mathbb{R}^n$? The argument should still work if you consider tuples $u(z) = (\mathbb{I}_A(z),0,..,0)$. – Cocopuffs Jul 5 '12 at 17:02