Similarity solutions of the porous medium equation with sign changes