I'll avoid trivial answers. I shall assume the Earth can be protected from the growing heat of the sun and the goal of this project is to keep the core of the earth warm. Also, this is not a science based tag so there will be no equations.
Let's begin:
The Magnetic Feild
The Earth's Magnetic Feild is thought to be produced by a Geodynmao and is the result of the interactions between convection in the core and Earth's rotation. The outer core is still liquid due to the primordial heat and radioactive decay (there is even evidence for a fission reactor in the core), while the inner core is solid due to the immense pressure.
Inner and Outer Core
As has been pointed out they are hot and hard to reach. You can read up on the specifics of the inner core here and outer core here. For the purposes of this project, there are only two things we need care about: the inner core needs to stay solid and the outer core needs to stay liquid.
Save the core, save the magnetic field
All we need to do is keep the outer core liquid. How? By delivering an enormous (by our standards at least) amount of energy to it. Firstly it could be done without remelting the whole of the earth. Humanity of the far future should be able to harness that kind of energy.
I don't see a chunk of neutronium as being able to work because neutron matter when not in a neutron star decays rapidly, plus there is no real good way to keep it together to the core. Making it out of antimatter won't help if it can't reach the core either.
A beam or beams of neutrinos could very well deliver that heat to the core but the overwhelming majority of the energy in the beam would pass through the earth and be wasted.
So how do we keep the core of the Earth molten is a relatively practical way? Here me out: An Ultra High Energy Neutron Beam (UHENB) look closely not neutrino. Now this beam of neutrons won't be able to penetrate all the way to the core of the earth so it will need to be installed deep within the earth. By this time the mantle will have cooled greatly, and to be fair it's not really even molten. There will need to be a shaft a couple thousand miles deep into the earth for this project. This is doable, firstly a cooler mantel means the digging will be easier. The harder part will be preventing the shaft from collapsing under the pressure. I won't hand wave and say some super strong material. It could be supported by many layers of walls nested together with the spaces between the layers pressurized. The same principal was employed in old vacuum chambers. There are plenty of materials that can tolerate the heat and throw in a giant cooling system for good measure.
Why a UHENB? Because the neutrons have a half-life of about ten minutes and when they decay you get a good amount of energy. Those neutrons will also release energy as their kinetic energy is dumped during collisions or breaking apart atoms they encounter which is a bonus because those decay products add more heat. Your run of the mill neutron beam has pretty good penetration, amp it up several orders of magnitude and the beam could penetrate hundreds or thousands of miles in the core. But here is the key, at such high energies the beam will initially pass completely through the matter in encounters only after slowing down will it really begin to heat up the material it is passing through.
The Set Up
A thousand mile long particle accelerator that's business end is deep in the earth, protected from the heat and pressure by pressurized nested layers of walls. It's powered by the sun since the sun radiates more than enough heat energy to warm the earth. The whole system would be built at the poles with the neutrons directed into the outer core on a path tangent to the inner core and pointed slightly in the direction of earth's rotation. There could even be several of them. So now you are dumping energy (heat) into the outer core, adding a little energy to its rotation and increasing the radioactivity (heat). The outer core stays molten and rotating, the inner core stays solid and all the energy in the beam is captured by the earth.
Edit:
Turns out neutrons don't actually behave quite the way I described. According to this there are better are better forms of particle radiation for the task. An Ultra High Energy Particle Accelerator is what you will need, and a beam of whatever particles will do the trick.
Also, should add this will take a long time and the beams of particles should be swept around to improve heating and reduce hot spots because super volcanos are bad.