I don't believe any of the posts have well-answered the quesitons. I gave a lecture on magnetrons and microwaves last year for an upper division undergraduate E&M course at my university, so I should be able to shed some light on this subject.
1. How does a microwave cook food?
The photons (light particles) created by the magnetron are of a wavelength (12-13cm) that is easily absorbed by water, fats, and other organic materials. The absorption of these photons causes the molecules to vibrate, creating friction with neighboring molecules. In other words, the photons are converted into thermal energy (photons in the microwave wavelength region are usually associated with heat in astronomy).
2. What generates the waves emitted by a microwave?
The magnetron generates the waves and then sends them down a waveguide (a tube which you can use to transport waves; any good E&M book should have useful explanations and derivations)
3. Is it harmful to be around a microwave while it cooks?
Not usually; newer models can not operate with the door open, although older models could. The worst that can happen is you may develop cataracts if you experience prolonged, regular exposure. Modern microwaves are only harmful if the cooking chamber has been punctured or if the magnetron has been needlessly exposed.
4. If so, what is used to reduce/prevent harmful radiation?
Microwave radiation has a large wavelength and can't escape from the container in which it is placed. Ever notice the little rings on the viewing window? The door is designed so that the radiation can not pass through the door. Think of it as the photons have a wavelength too larg eto pass through the glass parts. The rest of the chamber is also designed to be reflective to microwave radiation.
5. How does the magnetron function?
This is a lot more complicated of a question that one might think. I have an Electricity+Magnetism textbook (I think it's Griffiths, but it might be Wangsness) with a great derivation and explanation in the appendix. You may even learn more by researching older RADAR systems, since those were the original uses for magnetrons. Ultimately, a magnetron produces the microwaves in a fairly broad low-energy spectrum and sends them down a waveguide into the cooking chamber.
6. What objects cannot be placed in a microwave and why?
Metals. The microwave radiation produced by the magnetron can cause currents to flow in metals (ie good conductors). This may cause a fire.
7. What causes "hotspots" in the heating of food?
Interference effects between photons cause spots of constructive and destructive interference. This is much like the interference pattern seen in single or double slit diffraction. An interesting experiment is to stuff the cooking chamber of a microwave full of marshmellows and let the microwave run for a minute or two. Take the block out and you can see some spots will have melted while other spots will have had no heating at all. This is a good motivating reason to have a spinning cooking tray; then hopefully whatever you're trying to cook is evenly heated.
8. How do microwaves affect the nutrient content of food?
They shouldn't affect the nutrient content at all. Cooking an object with a microwave should be no different than cooking an object with a good old convection oven, at least with respect to nutritional content. The taste can be different because a microwave heats more uniformly than a convection oven (which requires heat to conduct from the outside of food toward a potentially frozen or very cold center).
9. How much energy is used by a microwave, and how efficient are they?
Very little energy is used by a microwave, they are very efficient. When I held the lecture we derived that a microwave oven should take about 15x less electricity to heat the same volume of food.