How should a painted wall be prepared before being tiled?
Obviously the tiles can adhere no better than the paint is adhering to the wall.  So if there is any peeling you should remove the paint first.
In kitchens and bathrooms semi-gloss or gloss paint is often used.  The tile may not adhere to these as well as to other paints.  Usually washing with a product like TSP (tri-sodium phosphate) which is a super strong soap will rough the surface up pretty well.
In all cases, however, you should read and follow the tile adhesive manufacturer's recommendations regarding wall preparation.  The specific brand you are using may have different requirements.