I don't know if there's an actual answer to this question, but how did we make the transition from using flint and stone tools, to retrieving ore from the ground, to refining that ore into a metal, to then forging that metal into something useful?
I'm sure that there's a natural evolution to these processes, but I've never heard anyone discuss it.
First of all, mining predates excavations for metal-bearing ore. Evidence of prehistoric mining for flint nodules and for salt is clearly documented, so it is wrong to think that a need for metals spawned mining. Rather, the need for other things inspired people to dig in and beneath the ground. Prehistoric people did not need to invent the industry of mining simultaneously to make a transition to the exploitation of metals.
Early retrieval of tin in Cornwall suggests that it was easy to adapt the idea of excavations for flint to excavations for tin. Of course whatever the resource, people will first work the surface (a process that is also called mining). Going underground is costly and dangerous and is only pursued when there is a lack of surface resources and a clear incentive of rich underground resources. That said, people have been going underground for thousands of years.
Consider the use of tin in this early Bronze Age site, 1900-1500BCE in Britain's Devon; the use of bits of tin to decorate - and not to be fused with copper for bronze implements - was probably an initial inspiration for mining metals. It is only a matter of taking that practice and discovering how various metals interact. The point here is that the retrieval of items from the ground predates metal use, and once in the act of retrieving things like flint and salt, it is easy to imagine retrieving other things like metals, even before people realized the full potential of those metals.
Going to use a comparison to Minecraft here, bear with me. When you start the game you're running around in a pristine world. After a bit you've probably found coal and iron visible from the surface. As time goes on and the surface resources are depleted, you go deeper into the caves to find what you need. Eventually you're branch mining at level 5 looking for diamonds.
Humans in history followed this same sort of progression. In the stone age there was plenty of resources for tools and art at or near the surface. In certain places where a particular stone was found, humans would keep digging in the same places as long as they kept finding what they wanted. I believe there are a number of places where there's evidence of riverbanks/cliffs being dug into by people seeking flint, for instance. As technology improved to the point of being able to melt bronze, then later iron, there happened to be enough of these resources near the surface to support the development of the technology before humans had to dig progressively deeper to continue finding the resource. It was discovered that certain places were better to look than others, and a little bit on the surface typically pointed to more under the surface. The Athenians/Greeks for instance realized that there was a lot of silver in the ground at Laurium, so they just kept digging there and exploited that area for millennia. Recall that a particularly rich vein provided the funds to establish the Athenians as a major sea power between the Persian invasions. Same with the Roman gold mines in the Alps and Spain. As easily-reached deposits ran out, humans delved deeper with advanced mining techniques developing apace.
I saw an interesting question once that asked if the human race could reattain our modern world if every bit of our technology and advances were stripped away - essentially putting us back into the stone age overnight. The sad answer is probably not, since we would no longer have the technological means to get enough coal, oil, and ores to reignite the industrial revolution since all of the surface deposits are long gone.
edit for sources: Any book on the ancient Greeks will talk about the mines of Laurium, Kitto and Martin are decent short survey texts on the subject. Strabo included such things in his Geographica as did Pliny's Naturalis Historia, and Braudel mentioned the discovery of Roman mines in the Alps in his The Mediterranean and the Mediterranean World in the Age of Philip II, vol. I. Hamblin's Warfare in Ancient Near East discusses the technological change between the neolithic and bronze ages. Here's also the wiki link to a gold mine that's been worked since before the Romans. Note the relatively advanced method they employed for following the veins.
Here is a great article (scholarly context) covering your question:
The earliest known mine (with archeological evidence) is known as Lion's Cave in Swaziland. It dates to 40,000 BCE or earlier. The miners there were looking for haemetite to create ochre body paint for decoration or ritual.
Mining really took off in the Chalcolithic or Copper Age. We have many fine archeological examples in the Sinai showing very very early copper mines as well as turquoise and malachite (which contains copper). It is speculated that the Timna culture or Maadi were nomadic natives of the Sinai and spearheaded mining and metallurgy there -- a good way to make the nearby Pharaoh happy.
Notable sites in the Sinai are Timna and Serabit el-Khadim:
http://commons.wikimedia.org/wiki/File:Old_mining_place_in_Timna_Park.JPG
Here is a scholarly article about ancient copper production in the area.
Here is a scholarly article about Timna smelting
Some actual tailings and objects found in mines of Serabit el-Khadim:
hi! you may find some additional info of interest in this section of the FAQ*
*see the link on the sidebar or the wiki tab
That, since the discovery of mining and smelting predates history, is more of an anthropology question. You might try crossposting to /r/AskAnthropology
After reading all the comments. I feel the hardest part I perceive from OP's statement is how did ancient humans begin to notice the copper and tin ores, then move to the process of smelting the ore for use in tools and decorations.
The answer I seem to come away with is that the metals were found first in their purer forms such as gold dust and flakes, then naturally discovered to be malleable under common conditions such as is the case for pure gold and tin, but later experimented with into forms like copper and bronze. Does this hold water with what anyone else is thinking?
Even if this could be answered in depth, you would have to look at each continent and the people that lived there. Because even Mezo-, and pre-Mezo Americans and before were mining various metals from the ground as well as flints, and in some places even volcanic glass was mined in a few lands. Obsidian being one of the oldest sought after glass/flints, as it was used for everything from weapons to surgical blades. One cave, I think in France, they found where the people there had actually chipped out a wall. Flint and other useful material was found in the chippings so we know they were actually mining material where it looks they lived.