Mass density at a point is defined two ways:
- the limit of the average mass density in a volume containing the point as the volume decreases to zero, and
- as a field which is integrated to give mass.
Understanding how and when these two definitions are the same thing requires some measure theory -- at which time you learn how they are not the same thing.
Example of how they are the same thing. Suppose that the mass density (field) is a constant $1\, \mathrm{mg}/\mathrm{cm}^3$ at each point under consideration. Let $x$ be such a point. Let us calculate the limit of (for simplicity) spherical volume average densities for spheres centered at $x$. Let $r$ be the radius in $\mathrm{cm}$. The volume, $V$, and mass, $m$, are
\begin{align*}
V(r) &= \frac{4}{3} \pi r^3 \\
m(r) &= \int_{-r}^{r} \int_{-\sqrt{r^2 - z^2}}^{\sqrt{r^2 - z^2}} \int_{-\sqrt{r^2 - z^2 - y^2}}^{\sqrt{r^2 - z^2 - y^2}} 1\, \mathrm{mg}/\mathrm{cm}^3 \,\mathrm{d}x \,\mathrm{d}y \,\mathrm{d}z \\
&= \frac{4}{3} \pi r^3 \,\mathrm{mg}/\mathrm{cm}^3 \text{.}
\end{align*}
(The explicit units might make this mass look like a density. Recall that "$r$" in "$r^3$" has distance units which cancel the distance units in the denominator of the explicit units.)
Then the mass density at $x$ is
$\lim_{r \rightarrow 0} \frac{\frac{4}{3} \pi r^3 \,\mathrm{mg}/\mathrm{cm}^3}{\frac{4}{3} \pi r^3} = 1 \,\mathrm{mg}/\mathrm{cm}^3$. Notice that we must take the limit as $r \rightarrow 0$. We cannot evaluate the ratio of mass to volume at $r = 0$ since that involves division by zero. Now a graph of the function we are taking a limit of. From the algebraic cancellation (permissible under the limit, but not outside this limit), we expect to see a constant function.

The point $(0,1)$ is omitted, because division by zero is undefined. To sneak up on the value there, we use a limit. Note that if the density field varied (small fluctuations around a mean density and/or a trend to higher or lower densities away from $x$) we would see these variations in the curve. This very simple model doesn't have such features.