All I've heard until now is that when the Earth was very hot and slimy, the relatively heavier elements went down to the center of the Earth to form the core. But lately I've come up a contradiction or something. They say the gravity of the very center of the Earth is 0 because you'd get pulled from all the other directions. Then how did the heavier elements go down all the way to the bottom which shouldn't be the place that had strongest gravity?
When the Earth was newly formed by collisions with asteroids, comets, planetesimals and other debris of the early solar system 4.6 billion years ago, the planet was incandescent and the mantle hotter and more fluid than it is today. Just as you have heard, the heavy metals sank toward the centre.
And just as you say, there is a tiny place at the very centre where almost all the mass of the Earth and therefore almost all the gravity is outside this central point. Imagine this central point to be a cannonball. There is no enormous mass at its centre, pulling it down, and the gravitational field of the mass above it is pulling it outward and upward, so why doesn't it migrate back toward the surface?
You need to remember that only the imaginary cannonball is in this exclusive central position. For any substance close to it but not at the absolute centre, there will be more mass to one side of it than the other, so there will be a gravitational force pulling it toward that direction, in other words, toward the centre of mass.
The other thing to remember is that on top of the imaginary cannonball, in all directions, is a column of molten material reaching nearly 4,000 miles right up to the surface, and this column has enormous weight and pressure. Because of this pressure there is a substantial region where the iron-nickel core is solid. How did infalling heavy metals reach the centre if there is a solid mass there? Well,it wasn't always solid, and there was a stage when it was liquid. The gravity-free zone at the Earth's centre is purely theoretical and doesn't allow the centre to behave as though it were in zero gravity.