Typically, charge and mass densities do not extend throughout all of space, rather they are limited to the inside of some physical object. In some instances, it is useful to have an algebraic way of describing such a charge density that shows explicity where it turns on and turns off. You should be able to use step functions to write the charge density inside an insulating spherical shell (with finite thickness).