Most instruments have very old ancestors - the clarinet has not
It is not common knowledge how old music - instrumental music - really is. What we learnt at school is probably outdated at best, but mostly really wrong. We use to think that instruments came up not long before Sumeria. But flutes from bones have already been well known and used in the Stone Age. The oldest flute that we have today is from Baden-Wurttemberg, Germany, and is approximately 35,000 years old. It was produced from a swan's bone, at a time when drills were completely unknown. It has a nearly perfect pentatonic scale (like chinese music today). This is probably no coincidence. Other very old instruments have the same scale which tells us that folks already had a clear sound system idea 35,000 years ago. But: You only need a correct scale system like this if musicians want to play together. Shepherds for example won't need this - playing solo - and therefore typical shepherd's instruments will have a completely different system (like Arabic scales) with which you can't play together - but then again, you will find those systems are well defined, too. This old artefact with the perfect scale is no proof yet but you better get used to the idea that musical instruments and woodwind ensembles played in the Stone Age already - making music in ensembles seems to be less a hobby of a few but a basic part of being human.
As with the flute most instruments we know today are refinements of very old ancestors. We can see some of them on monuments and paintings that are hundreds - sometimes thousands - of years old. These pictures and sometimes broken artefacts tell us very little about the music that was made with them, just whether people have danced. But you find much more about it conserved in literature and even in legislature that gives us some idea how they were used and what effects they must have had (some Greek states have banned certain scales and types of playing because of the extasy it caused in the audience!).

- Etruscan Aulos, a double-oboe"
Today we assume that the ancestors of the modern woodwind instruments were developed in the middle east and have reached Europe via Turkey. Double reed instruments like the Aulos (a double oboe) in the Etruscan picture were already known in old Egypt and Greece.You see them on mural paintings in burial chambers and on wine jugs. These instruments developed gradually into todays modern instruments - the modern oboe and the bassoon as well as the instrument commonly used in Turkish popular dance music. A similar development can be shown for the flute, the trumpet, the trombone and all string instruments.
The clarinet, however, is the exception which didn't result from a gradual development of an already existing instrument instrument. The clarinet was a revolutionary development at about 1700, built upon the chalumeau.
The Chalumeau
Instruments with a single reed that were known as a shepherd instrument have existed for ages: The Zummarah and the Arghul. Such instruments were pipes, and the reed was cut out of the tube itself. We are talking about a rather simple instrument here. They are no candidates as direct ancestor of the clarinet. But there is one: The Chalumeau (spoken: Shaloomoh) was spread widely all over Europe. The name comes from Greek/Latin, where "Calumus" means pipe. The Chalumeau always was considered a shepherd's instrument, that had to be played solo. Unfortunately no Chalumeau has survived - one assumes that it must have looked much like a recorder and sounded like the lower octave of today's clarinet. It was not easy to play in tune. Therefore it was uninteresting for most composers and serious musicians, and was hardly ever used in compositions except for some shepherd scenes.
Nevertheless today we have kind of a renaissance of the chalumeau, and some companies beginn to re-build that instrument; both in a traditional and a modern form (see this Video at Youtube of a mordern form by Germany instrument maker Kunath).
Why is the Clarinet more than an improved Chalumeau?
The problem developing instruments similar to clarinets (like the Chalumeau) becomes clear when you think about what happens if you play a scale on an instrument like the recorder: There are eight or nine tone holes for the lower octave (as you have got 10 fingers) and there is an octave hole. "Overblowing" or opening an octave hole makes all other woodwind instruments sound exactly one octave higher than the note would sound without overblowing - all other instruments but not the clarinet. You learn this quickly and it is simple for the instrument maker: The tone holes and their distances for the upper octave are precisely the same as for the lower octave. In this contents you speak of lower and upper register.
The overblowing is different now for the clarinet: The clarinet overblows not to the eighth tone on the scale (an octave - which is exactly double the frequency) but to the twelwth tone. The italian word for this is duodecime, and so we call the overblowing key the duodecime-key. A beginner must learn this and get used to it. Furthermore this has implications on the construction of the instrument: The tone hole positions for the lower scale should be different from that of the upper scale. Since this is practically not possible, the instrument maker must find a compromise. The instrument makers before 1700 have not mastered this because they didn't have the theoretical background. Therefore the Chalumeau hasn't got an upper register. We still call the lower register of the clarinet the chalumeau register and the upper (actually the middle register) the clarinet register.
The "invention" of the clarinet
After having experimented with chalumeaus for a long time, the instrument maker C. H. Denner of Nuremberg, Germany, finally managed to build an instrument, that would not only play the lower register but also the upper one, without sacrificing to much of intonation (that is correctnes of the tone frequency). In order to do this he added two additional holes close to the duodecime key. The remaining problems with intonation the player had to correct with his embouchure.

- Woodcut print: oldest description of clarinets, 1740
The German text on the description of 1740 says: "Clarinetto, that is a wooden wind instrument invented by a Nuremberger at the beginning of this century. It is not unlike a long oboe, except that it has a wide mouthpiece. This instruments sounds from afar rather alike a trumpet and it reaches from the Tenor f up to the 2-dashed a, at times up to 3-dashed c.
On the left, the key table says (from top to bottom): Thumb-key, Thumb-hole, Forefinger-key/hole, Middelfinger (hole), ring-finger (hole), then right hand: forefinger, middel finger, ring finger, small finger."
The first clarinets were still very simple and looked much like a larger recorder. They had two keys, later three (our description depicted here shows two: left thumb and left forefinger). The new instrument already had a wider tonal range than oboes or trumpets of that time. And one could play it relatively loud and execute technically difficult runs and jumps besides, which would be impossible on a trumpet. Therefore one at first replaced the high trumpets, the so-called "clarini", with the new instrument. The name "clarinet" might have come from that.
So the clarinet was not just an improved Chalumeau, those two keys made it a completely different instrument. The result was sensational: It was heard in orchestras very soon. Vivaldi wrote or re-wrote three concerty grossi in 1740 already, and Händel composed an Ouverture in 1748, where he demanded clarinets in d.
It is widely accepted that it was C.H. Denner, who invented the instrument, and it is only he who is mentioned in a note published shortly afterwards (the Article above only writes about a "Nuremberger"). Lately it is being discussed whether there might have been others, but there is no proof for that.
In 1760 the famous (and at this time leading edge) Mannheim Orchestra already had a budget for two clarinet players, both musicians were at the same time oboe players, too. From 1778 on they were clarinet players only. Not long after that Mozart wrote his famous works for clarinet - including the concerto for basset clarinet in A (often called concerto for clarinet in A) - that are technically extremely demanding. Even with today's instruments they are a challenge for professional musisicians. At that time clarinets had five technically questionable keys. It is hard to imagine that you could play that music with those instruments at all, but it must have been possible, as the critics were excited (and you must not think that they did not know what quality in instrument making and playing was - it was the time when string instruments like Stradivari violins were built...)
Iwan Müllers Keys
Iwan Müller was a German clarinet player and instrument maker, who revolutionised not only the key mechanics. While old keys had a simple pivot-mechanic and felt pads, and hardly ever were reliable, he developed the spoon-key with leather pad and sunk-in holes with a conical ring, as you find them on instruments today:
Altogether Müller's clarinet had 12 keys. It was not so far away any more from what Germans play today. Next to this Müller changed the reed roughly into the form we use today, and developed the ligature. Unfortunately the Paris Conservatorium did not accept his developments in 1812, because the French firmly believed (some still do today) in the specific charakter of scales. This would be destroyed by a clarinet that could easily play chromatically (that is: in all scales). Until then clarinets could only play one scale.
Klosés instrument (the Boehm system) gains acceptance in France and in the rest of the World
Shortly after this the German flute maker Theobald Boehm brought about two improvements to the instrument making world: On the one hand, he created a mathematical basis for the perfect calculation of the position of tone holes and on the other hand, he invented the ring key. The ring key makes it possible to cover a hole larger than the finger that lies on the ring key. On this basis the Frenchman Hyacinthe Klosé developed the "Boehm" clarinet model, his instrument maker Buffet started building it in 1839. Being French himself, he was better prepared to deal with the gatekeepers of the Parisian Music Academy than Ivan Müller, his instrument was accepted and is played in the whole world today.
The Germans go their own way
In the German speaking countries the Boehm system did not become standard, here instrument makers improved the Müller System. The actual German system is called "Oehler" and is technically as good as the current Boehm System. I give you a short overview over the development, the systems and their differences here. Actually it seems you find more differences in the heads of the players, of how the instrument should be played and how they should sound, than you find technical differences between the instruments.
A third system - looks like German but isn't
You see a dixieland band and the old clarinettist plays on something, that is definitely not Boehm - it has got the the wooden sliding rolls of the German systems, but looks much simpler... Then this probably is an "Albert" clarinet, an old descendant from the Müller system, that has survived in Jazz and in Oriental Music (Turkish, Klezmer). It is still being built today for this purpose.