This post has been removed. As feared, it is an example of a "throughout history" question. If you have an interested in a specific region(s)/culture(s) and preferably time-period, then do repost. For example, are you interested in Europe? China? Meso-America? Are you interested in the ancient world (e.g. Romans), or immediately prior to the Rennaisance, or reactions to the Columbian exchange?
Also, for a question like this, keep in mind that all living creatures have to make decisions about what substances are safe to consume, so the earliest examples of this kind of decision-making by our species most definitely pre-dates written history. If you're interested in typical methods that mammals in general use, you might try x-posting to /r/AskScience.
If it's a plant, animal or compound that can be found in nature and is accessible, some human ancestor stuck it in their mouth well before we had language. Generation after generation of people playing "can I eat it?" led us to a pretty good understanding of what was safe/useful and what was not, but most of that happened way, way before any sort of historical record.
Not exactly related, but I think still interesting, is when humans do the reverse, that is, take something that isn't particularly useful and make it useful. For example, maize doesn't exist in the wild. It had to be bred from a type of grass that is (mostly) inedible.
http://en.wikipedia.org/wiki/Zea_(genus)
Into this:
http://en.wikipedia.org/wiki/Maize#Origin
Along the same line, the majority of wild almonds are actually poisonous, as in eating a dozen or so will kill a person, but every so often an almond tree carries a mutation that makes its nuts edible. Somehow our daring ancestors--who must have known almonds were poisonous--persisted in eating a few now and then, just in case, until they stumbled across the mutants.
Even with modern science, there's still a lot of "well, will you look at that" going on. Albert Hofmann discovered the effects of LSD when some accidentally came in contact with his skin. Viagra was being studied as a hypertension treatment originally--and then someone noticed all the erections.