Our teacher asked us if shaving cream is a solid, liquid, or gas. She didn't quite know herself.
Shaving cream is a special type of mixture called a colloid, consisting of tiny air bubbles dispersed in liquid. This particular type of colloid can further classified as a foam. Since the mixture itself consists of two distinct phases, it doesn't really make sense to classify the entire mixture as one phase. If you had to pick one though, it is most nearly a liquid since that is the dispersion medium.