Inverse Density as an Inverse Problem: the Fredholm Equation Approach