Problem understanding what densities of states represent I understand that the one particle partition function for a particle in a box can be written as: $$Z_1 = \sum_{k_x} \sum_{k_y} \sum_{k_z} (2s+1) e^{- \beta \epsilon( \vec k) } $$
My first question is that I'm not sure why we can also write it in the following way: $$Z_1 = \int_0^{\infty} g(\epsilon) e^{-\beta \epsilon}  d \epsilon$$
I don't understand what the the quantity $g (\epsilon) d\epsilon $ or the multiplicity of states in energy range $\epsilon + d \epsilon $ means physically. I'm trying to see what happens when I integrate: $$ \int g( \epsilon) d \epsilon $$ For various functions but I'm getting confused. I also don't see how from this function alone I can get expressions for things like the Fermi energy for $N$ spin $1/2$ Fermions in a volume $V$ or the Debeye frequency. Any help clarifying this would be great!
 A: Maybe it would help to look at a simple finite-dimensional example. Consider the hamiltonian
\begin{align}
H = \begin{pmatrix}
\varepsilon & 0 &0\\
0 & 3\varepsilon &0\\
0 & 0 & 3\varepsilon
\end{pmatrix}
\end{align}
The partition function in the canonical ensemble is
\begin{align}
Z &= \text{Tr}\,e^{-\beta H}\\
&= e^{-\beta \varepsilon} + e^{-3\beta \varepsilon} + e^{-3\beta \varepsilon}\\
&= \sum_{i=1}^3e^{-\beta \varepsilon_i},\\
\end{align}
where the sum is over all energy eigenvalues. However, we could also write this as a sum over distinct energy eigenvalues
\begin{align}
Z  &= e^{-\beta \varepsilon} + 2e^{-3\beta \varepsilon}\\
&= \sum_{i=1}^2g(\varepsilon_i) e^{-\beta \varepsilon_i},\\
\end{align}
with $g(\varepsilon_i)$ giving the degeneracy of the $i$th energy eigenvalue, i.e. $g(\varepsilon) = 1$, $g(3\varepsilon) = 2$. This latter expression is the same as your second equation with the integral, just with a finite sum instead of an integral. The integral is taken over all distinct values of $\epsilon$, and the $g(\epsilon)$ factor accounts for the degeneracy of energy eigenvalues at each $\epsilon$.
We need to include the density of states when finding, for example, the mean occupancy
\begin{align}
n = \int f(\epsilon) g(\epsilon)\,d\epsilon
\end{align}
to account for the fact that there may be multiple states available to occupy at each value of $\epsilon$.
The last integral you wrote down $\int g(\epsilon)\,d\epsilon$ just counts the total number of energy eigenstates in some range of energies.
