Dumpster diving (called "skipping" in the UK) is taking food or other objects out of dumpsters. Depending on the country the dumpster is in and who owns it, dumpster diving may be illegal.
In Susan Strasser's book, "Waste and Want: A Social History of Trash," she charts trash picking as part of the way the poor have been able to survive. Dumpster diving is considered trash picking.
According to Emoware.org, one of the web's most comprehensive guides to dumpster diving worldwide, dumpster diving may be considered a form of trespassing. It is up to the dumpster owner to press charges, give a warning or ignore dumpster divers.
Breaking into a locked dumpster or going into a shed or building to get to the dumpster may be considered malicious damage. Although the charge would not be for dumpster diving, the charge is indirectly caused by dumpster diving.
According to FreeganInfo.com, the result of the 1988 Supreme Court ruling for California vs. Greenwood states that skipping is legal in America because trash is considered public property.
Freeganism is a movement of people who are not homeless but live off of dumpster diving in an effort to reduce their carbon footprint, but they do not advocate trespassing or breaking into a dumpster.