Like most materials, foam rubber can be painted. The trick is to use water-soluble paints that are acetone free. Acetone can dissolve some foam rubbers and will eat away at your project. Before painting, however, make any necessary repairs to the foam rubber, as this material is easily damaged, accumulating gouges or holes.
Spackle over any gouges or holes your foam rubber project may have. Giving your project a smooth surface will improve your painting results.
Sand over the spackle after it has dried. Sand lightly so you don't damage the surrounding foam rubber.
Paint the foam rubber with a paintbrush, using a water-soluble paint. Brush lightly so as not to damage the foam. You can also use a spray acrylic paint, as long as it is acetone free. If using a spray paint, hold the can at least six inches from the foam surface, as the spray vapours can be damaging. Spraying will require multiple coats. Allow each coat ample time to set before spraying the next coat. Ten to 15 minutes should be sufficient.
Let the project dry thoroughly before touching it.