Aha! A question for me!
Humans have always been aware of their past, and through Oral tradition that past can stretch back a very long time. It is however a distinct thing to discover and study things that are partially, or entirely forgotten to living memory. Archaeology is somewhat unique in that it can shed a light on parts of the past that no one remembers, and no one wrote down. It is an interpretation heavy field, so there are often multiple possible correct answers, until more evidence comes along. There is no correct answer, for example, on what in Gods green Earth a Stone henge is for. We know it involved big parties, the Winter Solstice, and probably something to do with the southern cross constellation. But tying those up into a single explanatory theory, or historical narrative is not possible. Which makes it a great subject for people who like rigorous analysis of evidence, and drunken speculation over a curry after a conference.
I won't be able to be fully comprehensive as that would involve a multi-volume directory to a library to tackle, so my biases towards Britain and European development of the discipline will be apparent. I aim to give a general overview of how archaeology has come about and been used by people from as far back as we know, to how that wiggled it's way to the now.
Archaeology proper is a pretty young discipline in the grand scheme of things, and is arguably even younger if you want to shun early-modern attempts as "antiquarianism". But to include the general idea of studying unknown pasts through the material culture of past peoples, can be best described as beginning around the very late 17th century, and throughout the 18th and 19th century. But before getting into much detail on that I'll jump to the earliest "archaeologist" and work forwards.
In Mesopotamia, in around 550 BCE there was a Babylonian King Nabonidus who excavated the ruins of an Akkadian ruler known as Naram-sin. He excavated and studied the foundation deposits of a few temples, and subsequently had them restored, probably the first example of Cultural Resource Management. The temples where for Šamaš a sun god, Anunitu an Athene war goddess type. Nabonidus also excavated a sanctuary built for a Moon God in a separate dig, also built by Naram-sin.
Nabonidus' excavations and studies are pretty damn impressive given the apparent absence of formal discipline to draw upon. Until the invention of Carbon dating our guesses where as good as his for a lot of the dates in ancient history. Prior to Carbon dating much of our chronologies for prehistory where based on things like Egyptian King lists, and seriation, which proved to be off by thousands of years in some cases.
Herodotus is often cited as the father of history, but I personally reject that label as holding him to an unfair standard and opening him up for a lot of cheap criticism. He was more of an anthropologist than a historian, and his Inquiry into recent and older history is far closer to a general cultural survey of the people he interviews rather than an interrogation of events. He travelled and asked people what happened, and he gets different answers from different people. A lot of his Histories are focused on cultural practices, and discussion of myths and legends and how they relate to the character of a region.
Thucydides, who comes a bit later is very critical of Herodotus, and should probably be the one with the title of "Father of History" or better yet "Father of 'Western' History". He was far more systematic, and ditched Divine Intervention as a worthwhile subject for inclusion. He developed techniques of analysis and attempts at impartiality when interrogating a source.
Both of these Greeks only really delve into recent History, but Herodotus does make mention of Ancient Mythic history. Unfortunately he seems to have had similar sources to us, being Epic Poetry, and oral tradition for things like the Trojan War. Neither of them make use of Archaeological excavation, establishing floating chronologies, or looking for physical remains of events that are otherwise unrecorded, or beyond living memory. Herodotus did look at artefacts though, so there is that.
After this you have historians all the way through to the modern era, with detail on events being dependent on the regions literacy, and how interesting things where to the people who could write. For example Britain is ignored by Roman historians unless something sexy is happening, like a massive rebellion, or a Pirate King decides to make himself Emperor before being killed by his accountant.
In China during the Song Dynasty there was a tradition of archaeology. Scholars would dig up old stuff from prior dynasties and study them, and incorporate them into modern state ritual, and hold them as relics. Similar things went on in Christian Europe, Bones and bits and bobs from the classical world where held up as Divine relics, or bits of saints and formed the basis of a thriving tourist/pilgrim economy.
Vessels with Shang dynasty writing on where claimed to have been made by famous sages and historical figures, which made them valuable (Socially as well as Economically) to the people who could dig them up. The Polymath Shen Kuo ripped his peers to shreds by rightly noticing that just because something is old, doesn't mean it was made by a Legendary cool guy. He studied artefacts and recognised the handiwork of skilled members of the working class of times gone by. He criticised the use of archaeology to play politics, and enhance state ritual. He also pioneered some of the first examples of experimental Archaeology, and made educated guesses about ancient musical scales, and stellar cartography practices.
Archaeology was also used to correct written records during the Song dynasty, by using physical evidence to resolve discrepancies in written records. China also has some of the first examples of Archaeologists making shit up. Hong Mai (c12th) found that textbooks of the time where often simply wrong about certain artefacts, and demonstrated this by studying physical examples.
Back to the comfort of my own ethnocentrism in Britain, Antiquarian practices diverged from plain history with figures like William Stukeley. Who undertook fieldwork to assess the dimensions of sites like Avebury and Stonehenge. This blossomed for the next century with an increasing focus on field work and material culture, eventually crystallising in the 20th century with the professionalisation of the discipline. The use of Archaeology for propaganda, and Nation building is still prevalent, but is easy to spot and pick apart.
As for cave paintings I can't find any references to their study and discovery prior to the post-antiquarian, proto-professional academic establishment of archaeology. The oldest discovery I could find was Altamira in the 1850s, but I'm sure there where earlier finds, they just aren't in any of my books.