Common reasons for peeling paint include paint applied to damp wood, previously flaking paint or a greasy surface. Water leakage behind the wall or above the ceiling may also cause paint to begin to peel. When water leakage is suspected, proper actions must be taken to stop the source of the leak before repairing the damage.
Scrape off as much of the paint as you can with a putty knife. You need to remove all the loose paint or you will experience the same problem with the new paint job.
Apply a thin layer of patching compound over the affected area until it is level or slightly above the surrounding wall surface. Allow the compound to dry.
Sand the area with 220-grit sand paper until the patch is completely smooth and level with the existing wall.
Prime the patched area with a high quality stain-blocking primer to prevent bleed through issues.
Paint the patched area with a paint colour of your choice. Follow the instructions on your paint for best results.