How do you calculate density if you also account for gravity? Consider this. I have an Earth-sized quantity of water that I throw into space. Naturally, it will assume the shape of a ball.
Now hear me out. Density's definition generally assumes that it will tend towards equalizing accross the whole material. However, a strong force of gravity to me would indicate that it actually becomes denser the closer you are to the center of mass in this case. It certainly seems to be in the case of Earth's crust and core.
So is there some sort of simple formula that ties these two properties together? Have I made a wrongful assumption somewhere?
 A: 
Consider this. I have an Earth-sized quantity of water that I throw into space. Naturally, it will assume the shape of a ball.

Only if it is non-rotating and is not being influenced by a tidal field.

So is there some sort of simple formula that ties these two properties together?

Yes. It is called the equation of hydrostatic equlibrium.
$$ \frac{dP}{dr} = - \rho(r) g(r),$$
where $dP/dr$ is the local pressure gradient, $\rho(r)$ is the local density and $g(r)$ is the local gravitational field. This is the version appropriate for Newtonian gravity and it says that the the weight of a slab of material in dynamical equilibrium is supported by the difference in pressure between the top and bottom of the slab. The negative sign is because the pressure must be bigger below the slab.
To use the equation in practice requires some sort of connection between the pressure and density of the material - an equation of state. In the situation you hypothesise, both the pressure and density will increase towards the interior of the sphere of water.
