Common enough problem and can often be nothing more than a faulty door switch. A faulty door switch interferes with the central locking system because the locking system believes that a door is open. First thing to do is identify which door switch is not working or working intermittently. Open each door in turn and push the door switch in with your finger (located on the pillar of the body). Hold it there for 30 seconds and the courtesy light should go out, if not then thats the faulty switch. You can repair these switches with a little patience, or pick-up a replacement from a scrapyard for less than a pound.
Kev, April 2009