From What Is the Earth's Inner Core Made?

The Earth's inner core is made up almost entirely of iron. The iron is extremely hot but does not melt, due to the high amount of pressure from the rest of the planet.

The Earth's core is made up of an inner core and an outer core. The inner core is mostly solid iron that is somewhere between 5,000 and 7,000 degrees Celsius. It is ball-shaped and around 750 miles thick. Because iron is a magnetic metal, the entire planet is magnetic. The reason that the core is made up of metal is because iron is the heaviest and densest material on the planet, so when the Earth was formed, the iron sank to the center.