Did Rowling invent the Deathly Hallows, or did she borrow them from existing legends/stories? Both the whole idea of 3 gifts from Death; and specifics of each Hallow?
First of all, the general idea of deceitful "Gifts" from Death was somewhat lifted from Chaucer, as per JKR:
Jessie: Were the deathly hallows based on any realworld myth or faerie tale
J.K. Rowling: Perhaps 'the Pardoner's Tale', by Chaucer.
(Source: J.K. Rowling and the Live Chat, Bloomsbury.com, July 30, 2007)
Here's Wikipedia's summation of the tale:
Setting out to kill Death, three young men encounter an Old Man who says that they will find him under a nearby tree. When they arrive they discover a hoard of treasure and decide to stay with it overnight to carry it away the following morning.
The tale and prologue are primarily concerned with what the Pardoner says is his "theme": Radix malorum est cupiditas ("Greed is the root of [all] evils").
The tale ends with 3 people killing each other out of greed.
However, the learned people have various scholarly disputes on whether the 3 men met Death himself disguised as old man, or not; Wikipedia references this work for detailed analysis: Hatcher, Elizabeth R. (1975). "Life without Death: The Old Man in Chaucer's "Pardoner's Tale"". The Chaucer Review 9 (3): 24652.
Second, the idea of specific Hallows definitely traces roots to previous examples:
The Elder Wand:
The idea of a dark super-weapon is a pretty old one. See "Evil Weapon" and Legendary Weapon TVTropes for many examples... but famous implements of death (many of which purport to make the wielder unbeatable in battle and many have dark undertones) litter both human myth and literary fantasy; from Spear of Destiny to Excalibur to Witchblade to Tolkien's The Black Thorn of Brethil.
The Invisibility Cloak: This one is a well known trope.
Adding on to DVK's answer,
The Deathly Hallows symbol was taken from the Masonic symbol.
I was staying at a friend's house, I'd been writing Potter for six months and I stayed up when everyone else had gone to bed because I was watching the movie The Man Who Would Be King. (...)
There was something quite extraordinary that I only realised about 20 years later, so it seems very appropriate to say it now in the context of this exhibition. The Man Who Would Be King for those who don't know, is a story with Sean Connery and Michael Caine in it and it's from an old Rudyard Kipling story. And the Masonic symbol is very important in that movie. And it was literally 20 years later that I looked at the sign of the Deathly Hallows and realised how similar they were.
When I saw the movie again and saw the Masonic symbol, I sort of went cold all over and I thought 'is that why the Hallows symbol is what it is?' And I've got a feeling that on some deep subconscious level, they are connected.