As you might have guessed, the ideal gas law stops being useful when the gas stops being a gas. In a liquid or solid, particles are much closer together, and their interactions become much stronger and much more frequent. There is no general equation of state like the ideal gas law for solids or liquids.
You are already familiar with phase transitions of one very important substance: water. Water is remarkable as it is one of very few substances that can exist as a solid, liquid, and gas in ranges of pressure and temperature humans can survive. In addition, if you've ever boiled water for cooking, you've probably taken advantage of a common property of phase transitions! When you boil water, you don't have to worry about it becoming too hot - it reaches some temperature (somewhat dependent on your altitude) and then begins to rapidly turn into vapor and steam. During this process, the temperature doesn't change very much, and yet more and more energy is begin put into the system. This points to a singularity in a thermodynamic quantity - the density is discontinuous, as it is different between the two phases.
The blank low-temperature portions of the nitrogen graph correspond to the other phases of nitrogen. The orange dots in the nitrogen gas data are along a gas-solid transition, while the blue dots are along a gas-liquid transition. The portion of the gas-liquid transition visible in this graph actually contains a critical point, near which the gas and liquid phases are essentially indistinguishable, and one phase can be turned into the other without an abrupt phase transition.
Phase transitions are often analyzed in terms of an order parameter which describes the approximate microscopic state of a system. One of the easiest order parameters to understand is in a simple model of a magnet. A magnet's magnetic field comes from the alignment of individual magnetic fields of its atoms. Depending on the type of magnet, each atom has its own (very weak) magnetic field due to its electron configuration, and we call the combination of magnitude and direction a magnetic moment. The different magnetic moments interact more strongly the closer together they are, but whether they prefer to be point the same direction or opposite directions depends on properties of the material. We can define an order parameter which describes the system as the average of the magnetic moments over a large number of atoms, resulting in a continuous function. An important phase transition for magnets occurs at the Curie temperature, above which they no longer create a net magnetic field.
For this foray in to statistical mechanics, we will start out with a type of system much simpler than a magnet: Lattice Percolation.