Density is equal to mass over volume, so to set up the problem, you have
d = m/v.
Solving this formula for volume stepwise would be
dv = m (Multiply both sides by v)
v = m/d (Divide both sides by d).
v = (2.5 g)/(5.00 g/cm^3) = 0.5 cm^3.
Your answer can have no more significant figures than the number with the least significant figures. That number would be the mass (2.5g has 2 sig figures), so your answer can have only 2 sig figures. Hence, volume would be 0.5 cm^3.
The source: https://www.dartmouth.edu/~genchem/sigfigs.html
says in rule 3, "Zeros to the left of the first non-zero digit are not significant."
Your correct answer should read, using rule 4 "If a number ends in zeros to the right of the decimal point, those zeros are significant.": `0.50 cm^3`
Volume of an object is the ratio of its mass to its density.
And in case of multiplication or division, the answer cannot have more significant figures than the number being multiplied or divided with the least significant figures.
Here the mass of the block has only 2 significant figures (density has 3) and hence the volume will be rounded off to 2 significant figures.
i.e., volume = mass/density = `2.5/5.00 cm^3` = `0.5 cm^3` (2 significant figures)
hope this helps.