Vitamin C (ascorbic acid) works to slow, even halt the browning of avocados, even in the face of salt, vinegar (in salsa), and lime juice, all of which have been shown (or will be shown) to speed browning. At a concentration of 100mg per 50 grams of avocado, it is also virtually tasteless.
You can buy pure ascorbic acid powder, which I did and then promptly lost, or you can use a spice grinder to grind very pure tablets, which I also did. My tablets weighed .59 grams per 500mg tablet, so close enough. I also tasted the powder and it really had no unpleasant chemical flavor, just a bit of acid effervescence feeling. You don't need to dissolve the powder, you can just stir it into mashed avocado. To keep sliced or diced avocados green, mix 1/2 tsp of the powder in 1 TBS of water (it will take some effort to get it mixed, but it will mix) and paint it on the surface or dunk in chunks, let them dry and refrigerate, covered.
As shown in earlier experimentation, cutting off all air significantly slows browning. That means not just a lid on Tupperware, but vacuum sealing, a sealed Ziploc bag with the air removed, or at least Saran Wrap* actually on the surface of the avocado. The same principle applies to adding a layer of water, sour cream, or salsa over the surface of the avocado.
Enclosing the avocado with diced red onion significantly slows browning as long as the container stays closed.
*I specify the brand name of the plastic wrap because I have learned that permeability of plastic wrap varies, and Saran Wrap is the brand I’ve tested.
As Ogrecon’s answer says, diced red onions slow down browning significantly, as long as the container that holds the onions and avocado remains closed and airtight. The onions release propanethiol S-oxide gas (that's what causes tearing), and as long as that gas doesn’t dissipate, that gas prevents the avocado from browning.
This picture is of otherwise untreated avocado after nine hours in the refrigerator, tightly covered in tupperware containers. Even the containers are identical. One side has the onions, the other doesn’t.
I removed the lids to snap the picture. I replaced the lids, and within thirty minutes, I could see the avocado starting to brown on the side with the onion. By morning it was all over.
So, if you want to make guacamole in advance, one option to keep it fresh looking is to enclose it with diced red onion. Don’t remove the lid until time to serve. I specifically say red onion because that is the only onion type I tested. Stored like this you can taste the onion, but I find that flavor complimentary in guacamole. Nine hours isn't necessarily the limit; the onion experiment gets even better; I’ll cover it more in the section that covers Vitamin C.
I had read that salt speeds browning, and I knew from earlier experimentation that lime juice and vinegar speed browning. I looked at Vitamin C as possibly being effective against browning.
I added the factors of salt and Vitamin C to the testing of scoops of avocado left uncovered at room temperature.
At 2 hours the results are evident. Lime juice and salt both speed browning. Uncovered and unrefrigerated the Vitamin C doesn’t seem to make much of a difference.
Per each 50 grams of avocado (as indicated), I used 100mg of Vitamin C powder, 250mg salt or 1/4 tsp freshly squeezed lime juice.
Refrigerated and covered, Vitamin C is a whole different ball of wax.
I made guacamole using my favorite method. Into mashed avocado I mixed salt, lime juice, fresh cilantro and drained Pace Brand Hot Salsa. (Per 100 grams of avocado I added .5 grams of salt, 1/2 tsp of freshly squeezed lime juice, about a TBS of chopped cilantro and 2 TBS drained salsa).
I treated half the guacamole with 100mg of Vitamin C powder (ascorbic acid) to each 50 grams of guacamole.
Tightly enclosed in little Ziplocs, with no air exposure at all, both samples are still acceptable at 4 full days (96 hours). The Vitamin C treated sample shows no browning at all:
Since the layer of red onion kept avocados from turning brown for 9 hours if the lid wasn’t removed, I kept the lid on guacamole samples enclosed with red onion for the same 4 days. Again, both samples are acceptable, but the sample with added Vitamin C shows no browning at all:
Vitamin C so effectively stops avocados from browning that refrigerated just in a regular Tupperware container (just with the lid on, nothing on the surface) that even in the face of salt, salsa and lime, the guacamole is still perfectly fresh at four full days.
So, the bottom line is this: Add Vitamin C to guacamole to keep it fresh and green for a full four days. With the addition of Vitamin C, it actually stays green for even longer, but I suspect that other freshness issues would start to come into play at that point. Use a baggie, a Ziploc bag, Saran Wrap, Tupperware, whatever, as long as it’s covered.
OK, I don't necessarily advocate eating week old, homemade guacamole, but it's late and I'm hungry. I ate this. It's a full week old, it's green (not perfect, but pretty close), and it's yummy. Hey! I've got chips getting stale, don't judge me!
The second best option is to keep the guacamole tightly sealed with freshly diced red onion (other onion varieties may work, but I only tested red). The guacamole will stay perfectly green for at least 9 hours, and acceptable for 4 days, even without the addition of Vitamin C as long as you don’t open the container. So this would be fine if you want to serve guacamole at a party and want to make it in advance.
As a third option, vacuum pack the guacamole or use a Ziploc bag with all of the air removed. Even without Vitamin C or diced onions, the guacamole will stay marginally fresh and green for four days. The above options give better results, but giving the guacamole no air at all will keep it from browning unacceptably.
Note: I found Wayfaring Stranger’s answer very compelling. I had wanted to include sodium bisulfite in this experiment, but I had difficulty getting it, there are strict shipping rules regarding it. Why? Well, because it’s dangerous. I tried different shipping companies, different sources and obscure local chemical firms. There came a point when I realized I was being silly, no one here is going to buy a compound labeled, “May be fatal if swallowed” to keep their guacamole green. Yes, it is used commercially for that purpose, the results of that experiment might be interesting, but those results are unlikely to have practical value to anyone who would read them here. Since the Vitamin C is both safe and efficacious without the sodium bisulfite, I’m quitting while I am ahead.