I've found that the best way to extend the life of a ripe avocado is to:
mash it up, put
put it in a plastic container, flatten
flatten it out a bit, cover
cover it with an inch of water, and
and finally put the lid on the container and put it in the fridge.
It will keep for a few days like this. The water will seal the air out. After a couple days you may have to scrape off the top layer of avocado.
Someone may know a better way but besides seeing that the avocado is bad (which should suffice for most cases) you have to feel it. If there is very little resistance then it's probably bad. Cut it open and see.