For instance when you buy gold leaf to check that it's really gold. Or to see if your water is contaminated with, say, lead or PFOA. Or even to compare different kinds of water, like different brands of bottled water.
As it is, as a consumer, I have to rely on marketing and regulatory oversight. And while there are commercially available tests for, say, water contaminants or phthalates, these are expensive, they are slow, and they only test for specific compounds.
Ideally, I'd like to have a device that I can just point at a sample, and which will tell me exactly what atoms are present in there, and, ideally, a list of probable compounds.
Is there any device that does this, even just remotely? If not, what obstacles are there for such a device to exist?
Look up handheld or portable spectrometer. There are a lot of them that are more lab / industrial focused (and priced!).
Really what we want is a tricorder. :-)