If the pressure of the Earth is keeping the inner core solid, keeping it rigid to take up the least space, and temperature is dependent on how much the atoms are moving, why isn’t the inner core cold? If the pressure is so high that it’s forcing the inner core to be solid then the atoms can’t move around and thus they can’t have temperature.
Your argument would require that all solids must be cold, because all solids have constituent atoms that are constrained to remain in their solid lattice positions. But clearly not all solids are cold, so there is something wrong with your argument. That thing is that atoms or molecules constrained within a solid structure can still vibrate and oscillate around their equilibrium positions. So they do have an internal energy and this is where the heat is stored.
Your association of temperature with "how much the atoms are moving" is fine as rough description, but it can't really be used as-is as an an accurate, quantitative definition of temperature. Even if a solid is under high pressure, it can also be at high temperature. It's true that the amplitude of the atomic vibrations of the high-pressure, high-temperature solid may not be as large as the atomic vibrations of the same solid material at zero pressure and at the same high temperature, but there is no suppression of the absolute temperature because of high pressures.
Having said that, there is a special sense in which one may be able to say that the solid at some high pressure and temperature is at a "lower effective temperature" than the same solid at zero pressure and the same temperature due to the smaller atomic vibrations of the high pressure solid. There is a term called the "homologous temperature" of a material, which is the temperature of the material (in Kelvin) divided by it's melting temperature (in Kelvin), or in other words the material's temperature relative to its melting temperature. According to the Lindemann melting criterion, many crystalline solids melt when the average amplitude of their thermal vibrations reaches a certain fraction (typically 0.15 to 0.3) of their interatomic spacing. So by applying high pressures to a solid at a fixed temperature one can indeed often reduce the homologous temperature of a solid (but not its absolute temperature) due to the suppression of its atomic vibrations and the raising of its melting temperature. In fact, note that the temperature of the Earth's iron solid inner core is estimated to be around 5430 ˚C which means that the melting temperature of iron has been pushed to temperatures above 5430 ˚C due to high pressure. In contrast, the zero pressure melting temperature of iron is much lower at 1538 ˚C.
The core is hot because of radioactive decay. If the pressure applied to a liquid like molten iron is great enough, it will get squeezed into a solid, even though it is tremendously hot. This is why the center of the earth's iron core is a solid. If that tremendous pressure were released, the iron would immediately melt to a liquid (and probably explode into iron vapor right afterwards).
I'll answer by analogy with a spring:
- Temperature <=> Energy in vibration of spring
- Pressure <=> Compression of spring
- Phase state (solid or liquid) <=> Movement of the spring
Temperature is basically the energy of the moving particles.
If you take our analogous spring and have no weight on it (no pressure) it can bounce around with great movement as a liquid would. By virtue of the momentum of how fast the spring can travel in this state, it has high "temperature".
If you put a heavy weight on it (and thus apply pressure), the force from the spring becomes very high (with the same amount of energy), but obviously the distance it covers is a lot less. The energy in the spring is the same (equivalent to being the same temperature but in a solid state).
End analogy, the spring can have the same amount of energy in it's vibration, but one case can be constrained by weight (high force, low movement) and is free (low force, high movement).
For two main reasons:
The formation of the earth was approximately an adiabatic process, and adiabatic compression increases temperature. The energy that wasn't stored in chemical bonds or radiated away didn't just disappear. It's still there, in the form of atomic-scale motion. Instead of having Brownian motion like gas molecules, the atoms in the earth's core are wiggling around within a tiny space. But it's still motion.
Radioactive decay releases energetic particles that bounce off of the other atoms, adding to the total amount of bouncing.
Think about what happens when a billion perfectly elastic balls zipping in every direction through space are all pulled in toward their shared center of mass. They'll start bouncing off of each other; the closer they are together, the more frequently they bounce. At the center, they're so close together that they can't move past each other, but they're still bouncing extremely rapidly within their "pockets". Meanwhile, some of the balls are shooting out little bullets that then bounce around between the balls.
Temperature is more like the vibration of an atom. That has nothing to do with how much it can move around in a liquid.
The gravitational pressure makes the core hot in the first place. The atoms are pushed so close to each other that they rub on each other.
EDIT: Ok as commenters have pointed out 50% of the earth cores heat is left over from the gravitational forces during earths formation and the other half due to radioactive decay.
Even assuming a model where temperature is only average kinetic energy of atoms and molecules, lowering the amplitude of average displacement doesn't imply decreasing temperature.
If we have $N$ gas molecules in a box at a given temperature, and replace it by $M$ smaller boxes, equaly dividing the particles, there is no reason to think the temperature will change. But their amplitude of displacement decreased.