The study of earthquake waves and their behavior as they travel through the body of the Earth is but one way scientists have to probe the interior of the Earth. Studies of the planet's gravity and magnetic fields offer ways to probe what is happening in the deep interior. Scientists also use volcanoes and earthquakes to probe into the Earth, or create earthquakes of their own by detonating tons of explosives and listening to the seismic waves with seismometers. Traveling all over the globe to gather samples from places such as volcanoes, impact craters, the sea bed and mountain ranges is yet another way for scientists to get clues about the interior of Earth. Lastly, laboratory experimentation has provided scientists the chance to simulates what they think is going on inside the Earth based on their observations in the field. Satellites also are being used to study the Earth and how it works as a dynamic, living system.
Seismic waves caused by earthquakes bounce differently off different masses. These waves are recorded and measured. They know there are different layers in the Earth because of the different readings from single earthquakes. They know how fast the waves move and can determine how thick the the layer actually is by how long it takes the wave to bounce back. Its very similar to sonar.
Mostly by studying the waves that travel through the Earth from earthquakes and ground movement.
The Primary and Secondary waves that radiate out from the epicentre of an earthquake travel through the Earth, and are reflected or absorbed by the changes in density and material composition of the different layers of the interior.
They also study the magma from volcanoes to learn about the gases and elements in it.
Plus study of the magnetic field around the Earth gives them data about the metallic composition of the core.
Lots of measurements, experiments, physics, and mathematics over decades have revealed what scientists believe to be a relatively accurate picture of the Earth's structure.
One way is detecting Earthquakes. By knowing where an Earthquake happens, and determining the type, force, and time it takes to detect them, they can make guesses about the Earth's interior. Detecting quakes on the far side of your station happens faster the denser a material is; by determining exactly how much time it took, you can determine exactly the density of the material. The force with which you detect them can be used to determine the type of material the waves traveled through.