The state of a substance not just depends on the temperature but also the pressure, because the pressure of the inner core is so look high the liquid iron in the core turned solid. If the pressure was the same as the outer core then the iron in the inner core would be in liquid state.