There, that was easy. :-) Or Qððāfī, if you want to be annoyingly uber-geeky. Spelling it as قذافي, while technically correct, is just cheating.
More seriously, I was curious as to why there are so many different versions of his name, and which one could be considered correct; so I did some research. Turns out there are two separate problems making it hard to get an accurate transcription.
The first problem, of course, is that 'Gaddafi' is an Arabic name, and the letters of the arabic alphabet don't all correspond directly to single letters in the roman alphabet, nor vice-versa. There are systems for transcribing one to the other, of course, but these have changed over time and not everybody follows them.
Secondly is the issue of what to do if you're transcribing a word from a language with quirky and non-phonetic spelling. For example, take the English expression 'tough guy' The same letter, G, appears in both words; but in the first, it's actually pronounced as if it were an F. So if you were writing out 'tough guy' in another alphabet like Russian or Greek, should you use that language's equivalent of G? Or F? There are arguments for either. Spelling it exactly as in English is more technically accurate; but anybody who isn't an expert in English spelling already would assume that the phrase was pronounced "tug guy". Which could be unfortunate if it were someone's name. :)
So, breaking down Gaddafi's name letter by letter, this is what we get.
The first letter in his name is the Arabic qaf. This represents a sound that doesn't exist in English, which is our first complication. Qaf does sound a little bit like the English letter K, however, so old-fashioned books simply used a K. Others used KH, just to show that the letter wasn't pronounced exactly like a K. More modern writers use the English letter Q instead, again to show that the sound isn't quite a K. Hence why the Muslim holy book was once called the Koran but nowadays is more often referred to as the Qu'ran.
So, the first letter in Gaddafi's name can be represented by a K, a KH, or a Q. Where does the G come from, then? Because in the Libyan dialect of Arabic, the letter qaf is not pronounced the way it is in standard Arabic... it's pronounced like the English letter G instead. In other words, the technically correct spelling according to the rules of Arabic would be Qaddafi, but the phonetic spelling is Gaddafi. That's how he actually pronounces his name.
(missing letter 'A')
in Arabic, unstressed vowels are normally omitted when writing out words. The technically correct spelling would jump straight from the Q to the d with nothing in between. In English, however, we do write out all the vowels. Gaddafi's name is pronounced as if an A were between the first two consonants, so that's how it's normally spelled in English.
The Arabic letter dhal comes next, doubled - which in Arabic is shown by putting a diacritic over the letter, but in English by repeating the letter. This is another letter that has a different sound in Standard Arabic and Libyan Arabic - and while it's a sound that does exist in English (although not in several other European languages), there's no longer a single letter to replace it.
Dhal represents the sound TH found in words such as this and that and the other. Six hundred years ago, that was written in English using the character thorn, or ð, but nowadays only linguists (especially the cunning ones) are familiar with it. Instead, the sound is sometimes written as TH, but also sometimes as DH to distinguish it from the softer, unvoiced TH sound found in words like thin and mathematics. Middle Earth fans will recognise the latter convention: Tolkien used the letters DH to represent the voiced TH sound in his languages, in words such as Caradhras or Fanuidhol or Caras Galadhon.
So, one way to spell Gaddafi's name would be Gaððafi - but only for people willing to use an obsolete Anglo-Saxon letter. Tolkien fans could instead spell his name as Gadhdhafi, which is a spelling I've actually seen used. Because that doubled 'DHDH' is such a mouthful, some people instead only write it once, spelling the name Gadhafi.
Except, of course, it's more complicated than that. In Libyan Arabic, the letter dhal is pronounced as a D, not a DH/TH. So the man himself pronounces his own name as Gaddafi, and that's the phonetic spelling.
The second vowel in his name is a long A sound, which is stressed. For this reason, the Arabic spelling of his name includes a character for the A, unlike the first vowel.
This is an F. It's pronounced exactly like the English letter F, and spelled as an F. It's the only non-controversial letter of his entire name. \o/
And finally, this letter is pronounced as a long I sound ("ee"). The only complication here is that a final I sound in English words is normally written with the letter Y, which would make the spelling Gaddafy. There's nothing actually wrong with that, but for some reason the spelling of foreign words normally stays with the final I instead.
And there it is. The BBC, and most other British news media I've seen, always use the phonetic spelling Gaddafi, which is pronounced just how it's written. But other versions include Khaddafy, Kadafi, Qudhdhafi, Gadhafy, and who knows what else. If in doubt, you could always cut and paste قذافي.
Any Arabic scholars who spot a mistake in what I've just written, please tell me.