The earth's interior is made of layers and the center of the earth (inner core) is probably solid with a shell (outer core) of molten material surrounding the solid core. It is this outer core that produces the earth's magnetic field, which has changed polarization numerous times (magnetic reversals) thoughout earth's history. Here is a fairly good link
Earth's Core
-Zeno