Your hardware store guy is right — chemically treated wood will leach into the surrounding soil. Lumber is typically treated with Chromated copper arsenate (CCA) to preserve it. The oxides and salts of the three metals — chromium, copper and arsenic — together provide as an effective fungicide and insecticide and also as a barrier against termites. From the wiki article:
CCA is known by many trade names, including the worldwide brands "Tanalith" "SupaTimber" and "Celcure". The chromium acts as a chemical fixing agent and has little or no preserving properties; it helps the other chemicals to fix in the timber, binding them through chemical complexes to the wood's cellulose and lignin. The copper acts primarily to protect the wood against decay fungi and bacteria, while the arsenic is the main insecticidal component of CCA.
These chemicals can, over time, leach into the surrounding soil and potentially even contaminate the water table. Here is some information from the National Pesticide Information Center
Chromium, copper and arsenic can leach into soil or water when wood treated with chromated copper arsenate (CCA) is exposed to the environment. Many factors can affect the amount of leaching that occurs from treated wood. Such factors include how long the wood has been exposed to the environment, the size and type of wood that was treated, whether the wood is coated with a sealant, water movement, and the type of soil. The chemicals that leach from CCA-treated wood can accumulate in soils near the wood, but under certain conditions, the chemicals can travel farther. In general, CCA chemicals are least mobile in organic soils, slightly more mobile in clay soils, and most mobile in sandy soils or water.
You can use untreated wood to create your raised beds. One way to tell untreated wood apart from treated is the absence of a greenish tint (mostly due to the copper in CCA). Wood that is used to make palettes and box crates are generally untreated (so raw that they don't even bother finishing it). However, you should be careful when working with them because they are so rough that you could easily get splinters. Best to get a few planks and run them through the planer if you have one.