Once the flesh of the avocado is exposed to air, there's no foolproof way to keep the cut surface from browning, but brushing it with a little bit of lemon juice will help. If you're not using the whole thing, wrap the extra avocado with the pit still in (the pit prevents the surface underneath it from browning) with plastic wrap and refrigerate. The brown may be unsightly, but it doesn't indicate the avocado has "gone bad". Simply cut off the unappealing top layer before you use it.
When you make guacamole ahead of time, place the plastic wrap right on the surface of the dip to minimize exposure to air. The worst that can happen is you have to scoop off a thin layer from the top—it won't brown all the way through after just a couple of hours.