A quick google-wiki-research shows that the phrase has biblical origins, Acts 12:23, “And immediately the angel of the Lord smote him, because he gave not God the glory: and he was eaten of worms, and gave up the ghost.” In that reference, I take it mean giving up your spirit or soul. Colloquially, I think it has come to mean completely giving up — in whatever context.

Origins of the phrase notwithstanding, I’ve just realized that I DO believe in ghosts. Maybe not Charles Dickens ghosts or Patrick Swayze ghosts or Ghost Whisperer ghosts, but ghosts nonetheless. I heard the phrase, “he gave up the ghost,” and wondered about its origin and then, that moment later, thought, “You have ghosts you won’t give up.”

There’s a poem in there.