First things first: Check the container for a Recycle symbol. A good place to start looking is the bottom of the container.
Take note of the recycle number inside that symbol. Once you've acquired it, cross-reference it with this list of plastics that are considered "food-safe".
#1 PETE (polyethylene terephthalate)
#2 HDPE (high density polyethylene). Make sure any #2 HDPE container is rated Food Safe.
#4 LDPE (low density polyethylene)
#5 PP (polypropylene)
Water bottles and soft drink containers have it simple and easy. They're primarily made of #2 PETE, a food-safe type of plastic. However, bear in mind that the typical water/soda/juice bottle is meant to be disposed of once used.