What elements are found in the earth's core?
Primarily iron-nickel alloys in both solid and liquid forms
The state depends on its temperature and pressure. It might change from liquid to solid at lower temperatures and/or higher pressures. Change from solid to liquid state, at higher temperatures, is understandable. Also, change from liquid to solid is possible at higher pressure. For almost all materials (except water), atoms are packed closer together in the solid state than in the liquid state. So squeezing atoms together under high pressure might transform liquid to solid.
Within the Earth both temperature and pressure increase with depth. Yet, the inner core is very hot and is in a solid state because it is experiencing very high pressure. The pressure in the outer core is not high enough to make it solid.