While more an annoyance than a hazard, squeaky bike brakes can be indicative of several problems. In general, the noise is caused by one or both brake pads failing to engage the rim (or braking surface) properly. This could be caused by something as simple as dirt and grime on the pads and rim, or more technically, by improper adjustment of the brake shoes. Giving the brakes a general tune-up will solve common problems such as these, and eliminate annoying squeaks.
Release tension on the brake by opening the brake arm quick-release or (if lacking a quick-release) lifting the cable from the body of the brake. The quick-release will be a small lever located on the side of the brake. Other brakes, such as V-brakes (commonly found on mountain bikes), may not have a quick-release, in which case you may be able to squeeze the brake arms together and lift the cable from its anchor inside the brake. Releasing tension on the brake will make it easier to access the brake pads.
Clean the surface of the brake pads using the tip of a rag moistened with rubbing alcohol. Do the same for each side of the rim, wiping off dirt and grime wherever you find it.
Use a nail file to gently abrade the surface of each pad. The will cause the pads to grip the rim more effectively than if they were smooth.
Restore tension on the brake by closing the quick-release lever or (depending on brake design) reattaching the cable to the brake.
Squeeze the brake lever, and check how the pads strike the sides of the rim. If the pads strike the rim squarely, you're done. If one or both of the pads is striking above or below the centre of the rim, proceeded to the next step.
Use a 5mm Allen key to loosen the bolt securing the brake shoe to the brake. By loosening this bolt, you can adjust the height of the brake shoe (and thus the brake pad, which is contained inside the shoe). Once the height of the pad is adjusted to strike the rim squarely during braking, re-tighten the securing bolt.