I'll preface this by reminding you that you should keep up-to-date on your local laws with regard to trail/sidewalk/road usage by bicycles. I've generally left things out that relate solely to legal matters. The lefts and rights apply to countries where driving is done on the right side of the road.
On trails (applies to dedicated bike trails as well as multi-use trails):
1) As with the hiking etiquette mentioned in another thread, be sure to check that you are on a trail appropriate for your use. Don't walk on bike trails and don't bike on walking trails.
2) Give an audible warning before passing.
3) Ride as far to the right as possible (may be different in countries that drive on the left?)
4) Do not ride more than two abreast. Ride single file when alerted to a passing bicyclist or if there is an oncoming cyclist.
5) Indicate stops or turns if there are cyclists behind you.
6) If you are a pedestrian on a multi-use trail, be aware of bicyclists and heed their warnings. Try to not walk more than two abreast.
7) If you are walking your dog on a multi-use trail, keep a short leash on your pet, as animals can become unpredictable if a fast-moving cyclist passes. Some dogs will be fine, some will not; the cyclist does not know which category your pet falls into.
8 ) Whether you are walking, biking, rollerblading, etc. on a trail, do so in a predictable manner. Don't weave across the path.
9) Do not use headphones. This reduces your awareness to your surroundings, which makes it harder for passing cyclists and such to communicate their intent to you.
On roads: Most road etiquette is covered by laws, but here are a few important ones...
1) Indicate turns and lane changes.
2) Keep yourself visible and ride in a predictable manner. Don't weave in and out of the parking lane, even though it seems like a good idea to ride over there when there are not parked cars, you are reducing your visibility to the motorists, which is unsafe for everybody.
3) Ride in the rightmost lane (bike lane if available) unless making a left turn.
4) If you are a motorist passing a cyclist, move into the left lane if possible. When this is not possible, provide ample space.
5) If parked on the side of a road, check for approaching cyclists before opening your car door.