How do scientists know the temperature of the inner core and the contents of the core as well?

No one has been there yet so how did they speculate so accurately?
8 answers 8