How do we know the thicknesses of each layer in the earth?
By using seismograms.
Earthquakes cause seismic waves. These waves travel inside the World. Storng earthquakes' seismic waves may be recorded all around the World except shadow zone.
Seismic waves can be classifed as body waves and surface waves. In order to understand layers in the Earth scientists use body waves. They are Primary (P) and Secondary (S) waves. After an earthquake seismic stations record P and S waves respectively. P waves are faster than S waves (Fig 1).
Since P waves are faster than S waves there is a lag between two of them. This lag has vital role to determine layers inside the Earth.
Waves get reflected and refracted when they hit the new layer. They get new names when they reflected and/or refracted when they hit the new layer(Fig 2). They also change their characteristics when they go through another enviroment. It's because of the new enviroment's density, heat, thickness and phase. All these properties effect the seismic waves and it causes different seismic records for the same earthquake.
When strong earthquake occurs, seismographs record it all around the World. They all looks different from each other since seismic waves travel different paths before they reach to seismographs. P and S differences, amplitudes are different since distances are not equal to epicenter of the earthquake. And also some seismograms have unique seismic phases that others cannot record.
Scientists use P and S lags and unique seismic phases and make Earth's interior models. Lots of earthaukes and their records are used in order to make models. They use density, heat, thickness and phase as variable while they're making models. They create time travel curves (Fig 3) by using this models.
When another earthquake occur they add its records to the model. Models can be more accurate with the help of new records.
Fig 1: Velocities of P and S waves inside the Earth. (Alt Manto:Lower Mantle, Dis cekirdek: Outer Core, Ic cekirder: Inner Core)
Fig 2: Earthquake wave paths
Fig 3: Travel Time Curve