Cracked paint in a bathroom is usually due to the underlying substrate (plaster or drywall) deteriorating or flexing with temperature and humidity changes. Bathrooms can be hostile environments for paint because of the high moisture levels. Painting over cracked paint without correct preparation results in an uneven surface and peeling paint within a fairly short time. If you don't mind a little hard work and mess, you can deal with that cracked paint and have a smooth and durable bathroom paint job.
Prepare the room by cleaning off the countertop, removing the shower curtain, and taking towel bars and switch-plate covers off the wall. Open a window or turn on the fan before starting work to speed drying.
Clean all the surfaces to be painted. Use a mild detergent and wipe down the walls, ceiling, and trim, finishing up with a clean water rinse. Make sure the walls are squeaky-clean and free of hairspray residue, soap scum, and mildew.
Use a chisel-edged scraper to remove as much peeling and cracked paint as possible.
Spread a thin coat of ready-mixed joint compound over uneven areas where you've removed old cracked paint. Use a 9- or 12-inch drywall knife. Since joint compound shrinks as it dries, it may take two or three coats to get a level surface. Sand lightly in between coats to knock down the high spots, and do the final sanding with a medium-fine sanding sponge. Wipe the sanding dust away with a damp sponge.
Mask the edges of anything you aren't painting, such as countertops, tile, and baseboards. Use blue painter's tape for the cleanest lines.
Prime the entire surface with one coat of oil- or tinted shellac-based primer. Allow it to dry as recommended on the label. Keep windows open or a fan going to dissipate fumes, because these primers are pungent.
Paint the bathroom with two coats of good-quality latex paint. Allow at least four hours' drying time in between coats and avoid using the bath or shower for at least 12 hours to allow the paint to dry.
Remove mildew with a mixture of one part bleach to three parts water. Spray it on, let it sit for about ten minutes, then rinse clean. Never use bleach with an ammonia-based cleaner because the mix causes the release of harmful chlorine gas.