This can be either discovery in ancient times or more recently (preferably both, if there is any evidence of possible discovery in ancient times).
Sometimes I think about how crazy it is that we had, essentially, these dragon-like creatures at one point existing on our planet. I expect when the first bones were discovered (my guess is somewhere in the 1800s but that could be horribly off), people's minds were collectively boggled.
The oldest certain find of dinosaur bones, not speculating or inferring, was by Chang Qu, 4th Century BC, Sichuan
http://www.smithsonianmag.com/science-nature/where-did-dragons-come-from-23969126/
The reaction was mystification and wonder, support for the existence dragons.
The first discovery of dinosaur remains definitely occurred before the time that humans began recording history. The matter of what qualifies as being the first discovery of dinosaur remains is more a matter of terminology, such as when the fossilized remains that were being found were actually considered to be those of dinosaurs. The first humans to inhabit the earth undoubtedly found the remains of dinosaurs, and ancient cave renderings that have been found throughout the world verify this. These early accounts of humans possessing knowledge of the existence of the dinosaurs have caused many to speculate that some survivors of the mass extinction 65 million years ago actually shared the planet with early man, but there is no solid proof of this. Although the first person to find dinosaur remains did so thousands of years ago, it wasn't until the 1800's that scientists actually put a name on the creatures whose fossilized remains they were finding, the creatures were from then on referred to as the dinosaurs.
The first written accounts of dinosaur remains having been found date back to the time of the ancient Greeks, who tried to explain the fossilized remains by creating epic tales of giants and mythical creatures. Chinese writings by Chang Qu that described the discovery of dragon bones 2,000 years ago also point to the discovery of fossil remains. There is no doubt that these early findings mystified those who found them, and given the curiosity of the human mind these relics begged for an explanation. Literature and beliefs regarding the origins of life on earth were altered by the discovery of fossils before they were even identified as being that of dinosaurs. Mythology and superstition was built around these enormous and strange looking bones, and from those findings there soon came stories about giants and dragons that once inhabited the earth.
The New Yorker wrote a fantastic article about this late last year. It's paywalled, though, for magazine subscribers only. (And, part 2.)
The short story of it is, though: way more recently than you'd have thought. And when people started digging up fossils for the first time, they were very confused, and didn't know what to make of them. Extinction was not a concept anyone knew to exist; the idea that hundreds of millions of years of outrageous creatures lay buried in the earth would have been the realm of sci-fi.
This has been some fascinating reading! Does anyone know of any preserved newspaper articles from when dinosaur bones were found in the 1800s or 1900s?
One important and fascinating part of this history involves the 11 year old Mary Anning, who with her older brother Joseph found the first complete ichthyosaur skeleton in 1811. They were poor kids hunting for curiosities to sell to wealthy tourists at the seaside town of Lyme Regis in England.
Worlds Before Adam: The Reconstruction of Geohistory in the Age of Reform by Martin Rudwick describes how these specimens were thought by some to be fossil fish, and others to be fossil crocodiles. Hence the proposed name Ichthyosaur: fish-lizard.
These finds occurred at a time when Geology was becoming a serious and systematic approach to understanding natural history. The Geological Society had been founded only a few years earlier in 1807, and Mary Anning's ongoing fossil hunting made significant contributions to the development of the early science.
There are many popular accounts that tell this story, including a Tracy Chevalier novel. Some Mary Anning links:
The first time that people realized that they were finding prehistoric, probably extinct creatures was the first half of the 19th century in Britain, where the limestone quarries and sea-shore cliffs provided numerous finds to fossil hunters like Mary Anning, who sold the fossils (ichthyosaurs to start, then Pleisiosaurus and Megasaurus) to geologists/anatomists who began to specialize in prehistoric fossils and gradually realized that there had been a whole prehistoric world filled with enormous reptiles. They first knew of the sea reptiles, then realized that there were giant land reptiles as well. There was a lot of attempted harmonizing with literal interpretations of Genesis, but that gradually gave way to a more scientific approach. If you're really interested in the subject, I highly recommend reading The Dragon Seekers: How An Extraordinary Circle Of Fossilists Discovered The Dinosaurs And Paved The Way For Darwin by Christopher McGowan.
In 16th century England dinosaur bones were taken as proof of giants, as recorded by Raphael Holinshed (the chronicler who gave Shakespeare much of his history).