...
The answer is that the earth's core will never be solid. And I do mean NEVER. Now, that being said, there is only one way it could ever happen and that is if the earth happened to get thrown out of its orbit to become a nomad planet. Then it might have time for its core to cool.
The reason I say this is because it will take longer for the earth's core to turn solid than it will take for the sun to run out of nuclear fuel and expand to engulf the earth. At that point, the earth will be vaporized as it spirals out of its orbit into the sun. The core would soon turn into incandescent gas. This will occur something like 4 to 5 billion years from now.
But don't worry, it won't happen, as I said.