It is almost impossible to imagine a time before writing. Our thanks should go to the cultures of the Ancient Near East. However, you might be disappointed to learn that writing was not invented to record stories, poetry, or prayers to a god. The first fully developed written script, cuneiform, was invented to account for something unglamorous but very important—surplus commodities: bushels of barley, head of cattle, and jars of oil! Here's a history of writing.
Cuneiform script is one of the earliest known systems of writing. Emerging in Sumer in the late 4th millennium BC (the Uruk IV period), cuneiform writing began as a system of pictographs. In the third millennium, the pictorial representations became simplified and more abstract as the number of characters in use grew smaller, from about 1,000 in the Early Bronze Age to about 400 in Late Bronze Age (Hittite cuneiform).
Scholars at Oxford University recently asked for help from the public in deciphering an ancient writing system. They plan to release high quality images of clay tablets covered in Proto-Elamite, a script used over 5000 years ago in what is now Iran. One reason the tablets have been so hard to decode is that they are full of mistakes, making it hard to find patterns. They hope that crowdsourcing will uncover some leads. In the meantime, here are 7 other scripts you might try your hand at deciphering. Here's the article.
Can you think of languages that have been invented more recently? What about morse code? What about pig latin? Language is incredibly versatile and ever changing -- who knows, maybe you'll invent the next language. Maybe somebody will have to decipher it thousands of years from now.
Matthew Winkler also did this TED-Ed Lesson about Joseph Conrad's Hero's Journey.