We know that there are Body waves (P-waves & S-Waves) and Surface waves, as a result of an earthquake. Scientists can use the information from these waves to analyze the earth's interior. The Body waves, P&S waves travel at certain speeds. Scientists can track the change in speeds as these waves move through the earth's interior, to make an educated guess as to the makeup and size of each layer. For example, Scientists know that S-Waves do not travel through liquids. They know that S-waves do not travel through the outer core. Therefore, they can determine that the outer core is a liquid layer.
Click here to watch and listen to Mr. Lee's Layers of the earth rap.