How do we know that dark matter energy density scales as $\rho\propto a^{-3}$? How do we know that dark matter energy density scales as  $\rho\propto a^{-3}$?
 A: Dark matter is assumed to be similar to ordinary matter, but without electromagnetic interactions. (The density of ordinary non-relativistic matter scales as the inverse cube of the scale factor, so non-relativistic or “cold” dark matter is assumed to as well.) This assumption seems to be validated by the observational success of the standard model of cosmology, called Lambda-Cold-Dark-Matter, particularly regarding the details of the cosmic microwave background.
So we “know” this in the same way that we “know” many things in physics: it is one part of an accepted and successful theory that makes other predictions which are observed. That leads us to have reasonable confidence that it is true.
A: The expansion of the universe is described by a solution to Einstein's equation called the FLRW metric and two related equations called the Friedmann equations. In these we have an energy density that is normally divided into three parts:


*

*relativistic matter and radiation

*non-relativistic matter

*dark energy/cosmological constant
For more on this see my answer to Is Dark Matter called "Matter" only because of gravity?
The three parts scale as $a^{-4}$, $a^{-3}$ and $a^0$ (i.e. constant) respectively. The densities of these three components were measured by the Planck experiment and found to be:
$$ \begin{align}
\Omega_{R,0} &= 9.24\times 10^{-5},\\
\Omega_{M,0} &= 0.315,\\
\Omega_{\Lambda,0} &= 0.685,
\end{align}$$
So we know that just under a third of the stuff in the universe scales in the way we expect non-relativistic matter to scale, and we therefore assume that it is indeed non-relativistic matter. However visible matter makes up only about 4-5% of the matter/energy in the universe, so we are left with 26% or so of stuff that is measured by Planck to scale in the same way as non-relativistic matter but that we cannot see. This is what we call dark matter.
So the answer to your question:

How do we know that dark matter energy density scales as  $\rho\propto a^{-3}$?

is simply that the Planck measurements tell us that there is around 26% of the stuff in the universe that scales as $a^{-3}$ but that we can't see. And for want of a better name this we have called dark matter.
So it isn't that we have determined that dark matter scales as $a^{-3}$, but rather that we have observed something scaling as $a^{-3}$ and called it dark matter.
