Depends on if you'll buy for instant consumption or for storage.
If you want to eat/prepare them right away, you want an avocado that feels soft on the inside, when pressing them they will cede and have that soft feeling ripe avocado has. It shouldn't cede very much though, as those are past their prime. The very good ones even smell in a nice avocadoey way a bit (or maybe that's just my insanity.)
If you want to prepare them later, you want firm ones that cede only a tiny little bit (the rock hard ones mostly never ripen in my experience,) you then store them in a porous bag (the typical brown paper bag or a newspaper) to let them ripe. To speed up the ripening, you can add an apple to the bag.
See also this related question
See the improved answer here: What DOES Help?
Which acid works best to keep avocados from browning?
Answer: None (of the acids tested)
It's not that acid doesn't do much to help.
ALL OF THE ACIDS TESTED CAUSED AVOCADOS TO BECOME MORE BROWN AND TO BECOME BROWN FASTER THAN NO TREATMENT AT ALL
I am not kidding.
Method
For acid, I used freshly squeezed lemon juice, freshly squeezed lime juice, distilled white vinegar (diluted to 5% acidity), and Ball brand Fruit Fresh mixed per package instructions, 2 tsp powder to 3 TBS water. Fruit Fresh contains dextrose, ascorbic acid, citric acid and silicon dioxide. According to the label, 1/4 tsp of the powder contains 230% of the US RDA of Vitamin C (ascorbic acid). That roughly translates to the solution I used having 100X the concentration of Vitamin C of lemon juice. I was not able find anything to give me a basis for comparison of citric acid concentration.
I diced 1 avocado and shuffled up the chunks so that no 1 pile had chunks from only 1 part of the fruit. I dropped the chunks into small bowls of the acids, removed the chunks, and allowed to air dry. They remained at room temperature for 24 hours.
I mashed 2 avocados together and put 50 grams of the mash into each of 5 small bowls. I added 1/4 tsp of each individual acid to each bowl, leaving 1 bowl plain. I mixed thoroughly and scooped the mash onto 2 plates, 1 to be refrigerated, and 1 to be left at room temperature. I washed and dried the scoop between changes in acid.
Results
The diced avocados just gradually became darker over 24 hours, with the vinegar treated fruit the first to show signs of browning, and ultimately the vinegar treated fruit became the darkest. The untreated fruit resisted browning the longest and ultimately browned the least. The lemon juice and lime juice were about tied, they both significantly sped darkening and ultimately became significantly darker than the untreated fruit. The Fruit Fresh barely made any difference, but the slight difference there was, was negative. Fruit Fresh also caused the avocado to become darker and to brown faster, but just barely.
At 24 hours all of the mashed, unrefrigerated avocado had become equally brown and unappetizing, it just happened faster to the treated avocado. The difference was most dramatic at 6 hours:
It's not clearly visible in the photo, but the Fruit Fresh treated avocado was ever-so-slightly more brown than the untreated avocado.
At 6 hours none of the refrigerated, mashed avocado was significantly browning.
At 24 hours all of the mashed avocado was the worse for wear. On the non-refrigerated side, it looks on this photo like the vinegar treated avocado ultimately fared the best. It actually didn't. I didn't think to snap a picture, but the vinegar treated avocado was the only one to discolor all the way through. The others were still green on the inside, the vinegar treated scoop was slightly browned even on the inside.
There came a point about 12 hours in that the refrigerated side just stopped browning. It had dried out, leaving it more green than the non-refrigerated side, but no more pleasant. All of the samples browned and dried out fairly equally.
At 48 hours I had one scoop of mashed avocado left that I cared to eat.
By adding nothing, keeping it refrigerated and covered in plastic wrap clinging to the surface, so that it had no air at all, this avocado is still fresh, green and ready to eat.
I'll add lime now for flavor, and some cilantro and cumin. Pass the chips.
Note:
I am honored that this answer has been so generously received, but the fact is, it really doesn't answer the question very well. This answer shows what doesn't help. As of 1/8/15 I have added and accepted a new answer based on new experiments that show what does help, it's HERE next to the checkmark.
Best Answer
If you buy them hard, and put them in the refrigerator right away, you can probably get a month out of them. After having been refrigerated, they will take longer to ripen at room temperature. So check them two days before you want to use them. If they're still a bit hard, leave them in a paper bag on the counter for twice as long as you would unrefrigerated avocados of the same hardness.