According to Wikipedia, the expected value of a continuous random variable is
$$E[X] = \int_{-\infty}^{\infty} xf(x) \mathrm{d}x.$$
Suppose $f$ is a function such as $f:\mathbb{R}\rightarrow (a,b)$. Is the expected value then undefined, since $f$ does not exist for $x < a$ or $x > b$?