I don't think it's possible to take a single function and plot it with different colors. You could of course add a bunch of plots of the different pieces as separate functions. You might find the rainbow() function very useful for this, try
sage: rainbow?