To give up the ghost. To die. The idea is that life is independent of the body, and is due to the habitation of the ghost or spirit in the material body. At death the ghost or spirit leaves this tabernacle of clay, and either returns to God or abides in the region of spirits till the general resurrection. Thus in Ecc. xii. 7 it is said, “Then shall the dust return to the earth as it was: and the spirit shall return unto God who gave it.”
“Man dieth, and wasteth away: yea, man giveth up the ghost, and where is he?”—Job xiv. 10.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Ghost from Infoplease: