The mantle and core of the earth are still hot because of the pressure of the overlying earth layers. The deeper the layer the hotter it is due to higher pressure, in lieu of the fact that temperature and directly proportional. In addition, some of the heat from the time the earth was formed is still trapped inside the earth and nuclear decay of radioactive elements in the regions ensure the earth does not cool.
The mantle and outer core of the earth are liquid while the inner core is solid. The former layers are liquid because the temperatures in these regions have surpassed the melting point of the elements that make up the layers. However, the inner core remains solid due to the enormous pressure in the region. The pressure is so high it prevents the element in the region from melting.