As you know, matter tends to clump together due to gravitation. But other forces resist this clumping once the matter particles come close enough to each other. This gives rise to pressure at every self-gravitating body like Earth or a star, though the forces resisting gravity are different in the Earth and in a star. The pressure is highest at the centre because the weight of all the outer layers are acting on it, and decreases as you go toward the surface, as you have rightly pointed out.
In a star, this force against gravity is provided by hot gases which are kept hot due to nuclear reactions. When all the nuclear reactions stop because the fuel has run out, the star may tend to shrink due to self gravity, until it can shrink no more due to some other force. For example, in a white dwarf, it is the electron degeneracy pressure which resists gravity. If the mass is too much, then no force may be able to stop it from shrinking, and a black hole may form.
Inside the earth, the pressure is very high compared to our standards, and is enough to form rocks or diamonds or fossil fuels. If you were put inside, you would get really compressed and burnt to a crisp.
If a small tunnel was drilled through a solid sphere passing through the centre, and you fell into it, then the motion would be an SHM, but I don’t think that was your question.
For math symbols, you can use latex. Click on the ∑ sign above.