Mythology is older than written history itself.  Even as far back in Neandertal times in Europe, there is evidence that the people had stories of their gods and spirits.  The advent of Mythology was an important event; humankind now no longer simply lived in nature, he was attempting to explain it.  Of course, myths and legends are still with us, although supplanted in large part by the sciences.