Why is the density of Earth higher at the core
Gravity is a weird force.

All mass has, and is affected by, gravity. That means you, me, your cat, black holes, the sun and the earth.

It also means each little bit of the earth is attracted to every other little bit. So every bit tries to get as close to every other bit as it can.

The shape that these bits form is a sphere - because every bit is as close as it can get to all the other bits.

Now you are right - an earth which is matter all the way through would attract in the same way as one which had all the mass concentrated around the edge. But we know that the centre isn't hollow for two reasons:




Volcanoes and Earthquakes. Volcanoes erupt liquid rock from the ground, which shows that there is something down there. And we know that there is something because we feel the shaking from earthquakes on the other side on the earth - and we can map the layers of solid and liquid from these.


  
  If gravitation decreases as we approach the core and if density is a function of gravity we should expect a void core.
  


No, because every bit wants to be close to every other bit. It doesn't just want to be near the bits on it's side, it wants to be near the ones on the other side, and so the "void" would close.


  Why is the density of Earth higher at the core?


The denser stuff sinks. This is how it works everywhere that gravity applies. We can explain why.

The denser objects have more gravity than the less dense objects. This means all the objects are attracted to the more dense objects more than they are the less dense objects. Here, red is more dense.

 

But the ones over the other side, are also attracted to that dense object, so this happens:



Eventually, you end up with all the less dense objects surrounding the more dense object, as they try to be as close as they can to it. But the more dense objects are attracted more to the other dense objects (as they both have more mass). This means all the dense objects clump together, surrounded by the less dense ones.