There is a solid iron ball at the center of Earth, roughly the size of Mars. This inner core has been estimated to be between one and two-thirds the size of the Moon; we don’t yet know its exact size or shape because it’s encased in a shell that is about as thick as a liquid outer core.
It’s surrounded by an outer core, which is composed of hot (4000 degrees) molten iron and nickel. The inner core’s size has been determined by the methods seismologists use to find out what goes on inside Earth.

They can’t see or touch it; instead, they measure earthquakes that originate in various parts of the planet, then map how these waves bounce around inside Earth’s interior.
Seismologists (scientists who study earthquakes) also determine the Earth’s composition by studying how waves reflected off different parts of its interior interfere with one another.
The interference patterns created by seismic waves bouncing around inside Earth are unique, like fingerprints; if seismologists find a certain pattern, they can identify the exact place in Earth’s interior from which they came.
They can also estimate how long it takes for waves to get from one point to another since waves travel at a given speed.
From this, they can calculate the distance from one point to another and determine the size of objects in between, including Earth’s inner core.

There are other ways to tell what the inside of Earth is like.
For example, scientists can study how seismic waves pass through various minerals and metals at different speeds; knowing these speeds, they can calculate the density of the materials inside Earth.
Scientists have also simulated conditions in Earth’s interior by using huge magnetic machines that heat samples of molten iron to temperatures comparable to those inside Earth.
They then move a magnetized needle through the molten iron, creating seismic waves that are similar to those acting on our planet’s interior.
By studying how these waves pass through different materials, scientists can learn about what they consist of and how dense they are; by studying them under different temperatures, they can learn about changes in the materials’ properties under the extreme conditions existing inside Earth.

Of course, there are limits to how much scientists can learn without directly examining what is happening within our planet.
As methods of studying it improve, we will learn more about Earth’s inner core; eventually, space missions may provide new information on its size and shape.