When you have to convert a quantity you need to multiply by a fraction whose value is 1 but has different units of measurements.
In your case you have:

You will have two fractions: one that transforms grams into kilograms and one
that transforms cm³ into m³. You need to position the quantities in such a way you can eliminate the original ones, therefore:

Now, you can make the calculations and you get:
=

Therefore your answer is: 1000kg/m³