Infinite number of microstates? I am having trouble in understanding the value of the number of microstates of a system, compatible with a given macrostate. I know the definitions and can perform the calculations. However when I start thinking about the problem of counting microstates in a intuitive way, I run into trouble.
Let's consider an ideal gas in a box. I don't see why the number of microstates doesn't add up to infinity. If you are bound to have a certain macroscopic $(E,V,N)$, the number of microstates compatible with that are infinitely many. What am I missing?
 A: You are right that the number of states in classical physics is infinite. Here, quantum mechanics comes to the rescue: If you solve the Schrödinger equation for your fixed volume $V$, you will find a discrete set of energy eigenstates. This set is still infinite because the energy can be arbitrary. However, if you consider only the states below a certain energy, this number will be finite.
For a gas, the classical space of states is $(\vec{x}, \vec{p})$ for every particle. This is called phase space. In the case with a fixed volume and limited energy, the volume of this phase space will also be finite.
As it turns out, there is a connection: You can roughly say
$$ \text{number of states} = \frac{\text{phase space volume}}{h^{3N}} $$
where $h$ is Planck's constant. Put differently: For a single particle moving in 3 dimensions, each state takes up a volume of $h^3$. I encourage you to look up the logic behind this, because I am not quite sure about it myself.
In thermodynamics, the way to incorporate this is to replace a sum over states $\sum_{\text{states}}$ with an integral over phase space $\iint \frac{d^3 x\, d^3 p}{h^3}$. For example, the partition function of a single atom is
$$ Z = \iint \frac{d^3 x\, d^3 p}{h^3} \mathrm{e}^{-\beta\frac{p^2}{2m}} $$
and the partition function of an ideal gas with $N$ atoms is just $\frac{Z^N}{N!}$. You can evaluate the integral explicitly: the integral of $d^3 x$ just gives you $V$ and the integral over $d^3 p$ is a Gaussian integral which becomes
$$ \left(\frac{2\pi m}{\beta}\right)^{3/2}. $$
The full partition function for an ideal gas is then
$$ \frac{1}{N!} \left[\frac{V}{h^3} \left(\frac{2\pi m}{\beta}\right)^{3/2}\right]^N, $$
from which you can derive the ideal gas law etc in a few steps. You can check that it is dimensionless, like a sum over states should be.
As you see, $\frac{1}{h^{3N}}$ only appears as a constant factor in the partition function, which means that its particular value doesn't affect anything. The important thing is that you count a constant number of states per phase space volume. So in practice, you can forget about quantum mechanics and just remember this.
A: In a classical setting, (E, V, N) has a continuous energy spectrum, while the microstate picture makes logical sense only if there is a discrete energy spectrum; for the continuous spectrum its equivalent is the density of states.
To see how this makes sense, try to derive Boltzmann's equation from the second law (hint: Lagrange multipliers).
A: 
Let's consider an ideal gas in a box. I don't see why the number of microstates doesn't add up to infinity.

Let's start from scratch based on one of the simplest cases we can think of: a monatomic ideal gas. 
We expect to get a multiplicity in function of its total energy $E$, volume in which the molecule moves $V$ and the number of particles $N$ (as in this examples $N = 1$, you do not have to worry about any extra factor related to $N$):
$$\Omega (E, V, N)$$
At this point, our objective is to get a formula for the multiplicity (i.e. the number of microstates associated to the macrostate of our molecule). 
Let's first tackle the volume's role in our formula
Let's constrain the movement of our molecule by enclosing it in a container of a finite volume. Thus, there's a finite number of microstates associated to such a volume. A twofold increase in such a volume will lead you to twice as many states as before. Thus we expect the multiplicity of our molecule to be proportional to the volume (not I am not going to delve into details like what type of volume; just notice we're dealing with phase space, so we have the volume related to position and the volume related to momentum):
$$\Omega \propto V_xV_p$$
We're not done yet. We still have to tackle the energy factor
At first (if we are used to think in terms of classical physics) your intuition correctly tells you that the number of microstates adds up to infinity, as we don't think of energy as being quantized. 
So you should change your approach and think of what Planck once said:

The energy could be a multiple of an elementary unit:

$$E = hf$$
Thus approach the problem of getting a (finite) multiplicity for the molecule based on quantum mechanics instead of classical mechanics (i.e energy thought as being quantized in discrete energy levels). 
HINT: You may argue that we will get an infinite number of allowed wavefunctions, and thus an infinite multiplicity as well. Note that the wavefunctions that determine the number of microstates of our system are linear independent and finite, so this won't be the case.
