|MadSci Network: Earth Sciences|
The heat of the Earth's core is a mixture of two sources. The first is the initial heat from the formation of the planet. That is, as the smaller bodies coalesced to form the Earth, their gravitational potential energy was converted to a good deal of heat. The second source is the (continuing) decay of radioactive elements in the bulk of the Earth (mantle as well as the core). In spite of the latter, the planet has been slowly losing net heat for quite some time. As this heat is lost, more and more of the liquid outer core 'freezes' to enlarge the solid inner core. A good book on the formation of the Earth is "From Stone to Star" by Claude Allegre, and this Mad Scientist suggests you read it. A large number of first year geology texts also discuss this.
Try the links in the MadSci Library for more information on Earth Sciences.