How long would it take for earth's core to cool down and solidify?
At what rate is the earth's core cooling down?


The inner core is cooling at the rate of around $55^{\circ} C$ every billion years.


  Would earth go the same way as Mars by first losing its magnetic field followed by its atmosphere as its core solidifies and cools down ?


Given enough time, yes; But earth is constantly producing heat though multiple processes, the most important being the decay of radioactive elements with long half lives (for e.g., U-238 has a half life of around 4.5 billion years). As the present temperature of the inner core is estimated to be around  $5000^{\circ} C$, this is going to take tens of billions of years.

The magnetic fields are generated by eddy currents in the outer core, which is a liquid layer about 2,300 km thickness. The inner core is growing at the rate of about 1 mm per year, so it is going to 'freeze over' (i.e. solidify) in about 2.3 billion years. Without its liquid outer core, the Earth's magnetic field shuts down, and charged particles emanating from the Sun gradually deplete the atmosphere, like Mars.


  Is it slow enough?


Well, it is not slow enough for the sun to become a red giant and fry earth, which will happen in 4 billion years or so. But is certainly doesn't matter as we won't be around to witness it.