Scientists believe that the earth formed around 4.5 billion years ago.
The core consists of a Ni-Fe alloy with a temperature 5000-5500 C. The core gives the earth a strong magnetic field, which deflects high-energetic particles ejected from the sun and protects life on earth.
The mantle consists of mainly Mg, Fe, Si and O and has a temperature range of 800-5000 C.
The crust consists mainly of either basalt (oceanic), containing Ca, Mg, Al, Fe, Si and O
or granite (continental) Na, K, Al, Si, and O.
The earth is not "solid as a rock".
Heat escapes from the earth's interior via mantle plumes and plate tectonics. Separation of plates causes hydrothermal vents and convergence or lateral sliding leads to earthquakes and volcanic eruptions. Most activity takes place at plate boundaries and is unevenly spread around the globe.