The idea of comes up a lot in modern culture. The most famous example is probably "The Devil Went Down to Georgia." Where did it all begin?
*Edited question for clarity. I originally mentioned Robert Johnson selling his soul to the devil and didn't want the two separate concepts confused.
The two themes you mention are old in folk tradition in western Europe. A series of Jack tales include the motif of outwitting or out-performing the Devil. The human hero plays the part of the trickster, and since that is a role the Devil himself plays in much of European folklore, stories include the motif of attempting to out trick the master trickster. The Charlie Daniel's Band exploited the attempt to outwit the Devil and combined that motif with the Devil with a fiddle, creating the fiddle contest with the Devil, a motif that one does not normally encounter.
A brief excerpt from my draft Introduction to Folklore on the subject of learning to play fiddle from the Devil, a very old motif:
Spirits ruling lakes and rivers in Scandinavia, for example, are often male. These spirits appear in animal or human form, but often they change between the two at will. In Northern Europe, they frequently manifested as an old fiddler of great skill. People suspected talented human musicians of having learned from this supernatural mentor at some great price. When transposed into a Christian context, people often regarded the spirit as the devil, who had purchased the soul of the musician in exchange for his incredible ability. The Northern European water sprite also appears as a horse, and there are many legends involving human interaction with this strong, unnatural – and dangerous – beast.
Oh man I can't believe my layman love for ancient Greek fables for once puts me ahead of actual historians and folklorists! Take that parents, who thought I was wasting my time reading about Greek myths instead of going outside to play when I was a kid!
I can get you a story about musical duel between the established deity of youth versus what will eventually become the established devil, from ancient Greece:
On one hand you've got Apollo, the god of music and light, depicted usually as a beautiful teenager, and on the other you've got what will eventually become the mischievous epitome of devilry, the Satyr!
As usual in the motif, the devil figure challenges the youth to a musical duel, and plays so well that the youth has to cheat to win. In one version the satyr claims to be able to play with his flute as well as the god of music can with his lyre, and actually manages to back his claim, until a pissed off Apollo flips the lyre around and plays it upside down, something a flutist can't reproduce. Another version has Apollo start singing, something a flutist can't perform either. Since it was agreed that the winner would do whatever he wanted to the loser, and Greek Gods are notorious for being gigantic assholes, Apollo, having won the duel, behaved in a rather futuristic way and went medieval on the satyr's ass. Or rather his hide. Which he took off by skinning Marsyas alive.
I'll sort of translate this wonderful fable/myth/story as a "We're the best around!" ego boost the Greeks tended to use, to make their lyre-playing selves feel superior to the flute-playing eastern Persians and Phrygians and other people associated with satyrs. (Fun fact: there's a Phrygian river called Marsyas, so the tale could also be explained as an anthropomorphized battle of the bands, with the beautiful youthful Greeks winning over the stinky hairy Easterners, showing off both their natural born talent and cunning in one single stroke.)
tl;dr ancient Greeks did it first! Youth archetype vs Devil archetype, Youth wins by cheating!
Apparently there were some 18th century Italian violinists who were rumored to have some association with the Devil: Niccolo Paganini and Giusseppe Tartini. As for general deals with the Devil a lot of people will point to the German legend of Faust, but certainly there was folk belief in Satanic bargains before that. The idea goes back at least as far as the writing of the New Testament, when the Devil tempts Jesus and offers him power and rulership of the world in exchange for worship.
I'm taking it you meant to type 'deal' with the devil instead of 'duel'
The earliest versions of the legend I'm aware of revolves around an Italian multi-instrumentalist who lived from the late 18th century to mid 19th century by the name of Niccolò Paganini
He played guitar and viola, but his area of expertise was the violin and he's often cited with a semi-mythical status as the greatest violin player of all time, based not on recordings, for he lived too long ago for those to exist, but rather on the influence he exerted on later generations of violinists.
He was instrumental in the development of numerous techniques for the violin and he was an early superstar musician - the norm during his lifetime was for succesful composers to be known but for musicians to be anonymous members of the orchestra or a quartet etc. He was pioneering in achieving fame in his own name for his ability to play his instrument superbly, apart from his compositions which also bought him renown.
The origins of the legend as it was tied to him aren't clear, there are several different versions at different points in his life
As a youth and a young man the narrative states that his father made the deal with the devil on his behalf, or that the devil is his father
As an established artist, known for a fondness for gambling and other vices the narrative is that he made a personal deal with the devil.
These sorts of rumours may have been attaching to other prominent musicians of the era - but they were solidified around Paganini when the Catholic Church initially refused to bury him in consecrated ground due to his perceived sinfulness (rock and roll life style - lots of parallels with later personages associated with this legend!) so the rumours gained currency.
Sources:
http://www.guitarramagazine.com/NicocoloPaganini
** THE BELOW LINK PLAYS MUSIC ON OPENING**
http://www.exploratorymusic.net/Hernandez%20page/woodland/Paganini.html