According to websters-online-dictionary.com, the word "soliloquy" was first used in 1613. It refers to a dramatic speech spoken by an actor to no one in particular, like talking aloud to yourself. For instance, Juliet's balcony speech, "O Romeo, Romeo, wherefor art thou, Romeo," is a soliloquy.
According to the online etymology dictionary, the word was first used as a synonym for "monologue":
c.1600, from L.L. soliloquium "a talking to oneself," from L. solus "alone" + loqui "speak." First used in translation of L. "Liber Soliloquiorum," a treatise by Augustine, who is said to have coined the word, on analogy of Gk. monologia (see monologue). Verb soliloquize is recorded from 1759.
Augustine was an influential Christian cleric who lived in the late 4th and early 5th centuries AD. So if he coined the term as the above reference notes, then it is ancient, indeed. As for the first play to use a soliloquy, after doing several searches, I can find only references to Shakespeare's plays. So it may be safe to say that he may not have invented the concept, but he was the first to widely use it.