1. A longitudinal wave involves oscillations of particles of a medium in the direction of wave propagation.
2. During the wave's travel, the medium undergoes alternating compression and rarefaction. In the compression region, particles are closely packed together, while in the rarefaction region, they are farther apart.
3. Since the density is defined as mass per unit volume, and volume changes in compression and rarefaction regions, the density of the medium will also vary.
4. Therefore, the correct answer is: \(\boxed{\text{density varies}}\).