While the temperature is incredibly high (around 5,200° Celsius), the immense pressure from all the layers above it is so great that it forces the iron and nickel to solidify.
It's a bit like a metal ball bearing under extreme pressure, even though it's hotter than the surface of the sun!