The etymology given by Webster below was in former days most credited, but the word is understood now to derive most probably from espada ropera, a Spanish term translating roughly to »dress sword« — that is, one suitable for civilian dress. As is common in English, the term was loaned via French, in which latter language it had become espée rapière; hence the word rapier.
The flourishing period of the rapier is from the mid-16th century to the early 18th; it developed in Italy from the earlier sidesword, a shorter cut-and-thrust sword typically plied with a buckler. The treatise of the engineer Camillo Agrippa of 1553 is considered the first fencing manual to treat with management of the sword according to the principles of a rapier; however, the development was a gradual and seamless one, and Agrippa's sword looks very much like a sidesword, a problem compounded by the fact that there was no particular word for rapier in Italian until the 19th century — each permutation was just a spada, sword, in its own time. The primary distinction between the two species is their length: a sidesword has a blade of about thirty-six inches, from which the rapier rapidly grew out to the point where, in the early decades of the 17th century, the blade was typically near ten inches longer. Capo Ferro, for instance, advises that the proper and natural size of the sword is such that it comes up to the wielder's armpit, which would give in my case a blade of fully forty-eight inches' length. From this utmost extent the blade eventually shrank, for a number of reasons, until Thibault and, at the end of the century, von Porath are back to recommending thirty-six-inch blades; and subsequently, largely for reasons of costume and convenience in civil life, the fashion moved to even shorter swords, producing the so-called smallsword, which ended the period of the rapier.
The rapier is seen as mainly a civilian weapon, but it also saw military use, as for example by the famous cuirassiers of Gottfried Heinrich von Pappenheim; and it is worth noting, that the most famous of the world's fencers, the Three Musketeers, were so called because they were soldiers, and they too wore their swords in the field.
The various types of rapier are distinguished mainly by their hilts:
The Milanese hilt rapier is the earliest type, and that also seen on the sidesword; all other hilt types are built on and incorporate a Milanese hilt. It consists of a crossguard with fairly long quillons, with half-rings on either side of the blade above the quillons, and possibly a knucklebow underneath. Gérard Thibault returns to this style of hilt in the mid-17th century because he is a weirdo.
The swept hilt is an early type, common throughout the rapier's existence, which no doubt is what most of you will think of when you imagine a rapier. Besides the above, it has 2-4 bars descending from the top of the hilt to the bottom of the knucklebow, now obligatory, forming a sort of cage around the hand.
The ring-hilt is much the same, only the bars are supplanted by 1-7 concentric rings on either side of the hilt. Normally a bar still reaches down either side to the knucklebow.
The cup-hilt is another common model, invented in Spain, which places a large hemispherical cup over the basic Milanese design. This has the effect of making the hilt noticeably heavier, but also of increasing hand protection significantly. Cup-hilt rapiers typically have very long quillons.
The Pappenheimer has a perforated plate on either side of the hilt, which has much the same effect as the cup-hilt of increasing hand protection, while being slightly lighter thanks to the perforations. It also incorporates one or two bars per side, to increase the protection of the knucklebow. It is notable in that it was devised expressly for military use by the aforementioned von Pappenheim, to equip his cuirassiers; and for this reason it is symmetrical, so that it could be mass-produced and used with equal ease by the left- and right-handed.
The shell hilt is quite similar to a Pappenheimer without the bars. Instead of perforations the side plates are counterfluted in the manner of a clamshell, which, besides being decorative, has the effect of stiffening the plates, according to the same principle as corrugated cardboard.
The dish hilt is a late form which is inherited by the smallsword, and which is much like an abbreviated cup hilt. It features instead of the full cup a round dish, sat symmetrically on top of the hilt and giving good protection to the hand from straight on; less so from the sides.
As for its management, notwithstanding the above assertions by user Zaf, it is almost entirely focused on the thrust, and Capo Ferro, to quote just one source, admonishes his reader that »for every cut there is a swifter thrust«. Not only was the rapier originally developed to serve in just this way, the blade geometry of the typical specimen makes it almost entirely necessary, because it makes it impossible to cut with effective speed and power. It is true that there is some significant danger in this, because although a successful thrust to the head or torso is almost invariably lethal, it has little stopping power except in the unlikely event that it kills instantly, and the opponent might easily kill one back if one is not well-guarded. For that reason there is a great deal of subtlety and skill involved in the use of the rapier, and it is a veritable art. The chief exponents of the art can be divided broadly into three schools, to wit, the Italian, the French, and the Spanish; and among all of them the laurel goes by general acclamation to the Italian Salvator Fabris, fencing-master to the Danish king, whose treatise was first published in 1606 and who may have moonlighted as an assassin.
There is a myth in regard to the art and use of the rapier, which likely springs from the later smallsword, that it is a light weapon suited to the dexterous, an idea which often sees the rapier placed in the hands of quick, sneaky thief-types and women; this, however, is not only inaccurate, but the exact opposite of the real state of things to a degree almost unexampled outside of young-Earth creationism. Rapiers are no lighter than other swords — nearly all one-handed swords of all periods are of roughly the same weight, in fact: 1-1.2 kg — and the extended guard in which they are held places a comparatively heavy strain on the muscles of the forearm and shoulder, so that, in fact, I know of no other sword which requires as much arm strength to use effectively. Rather, for the weak fencer I would advise use of the longsword, the basket-hilt broadsword, or the aforementioned smallsword, the social successor of the rapier, which really is very light and quick and is the weapon whose use modern sport fencing simulates.
The optimum course of study for the presumptive modern exponent would, I think, be first to study classical fencing for a year or so, which ought to give a solid foundation in footwork and general management of the body — at which the practitioners of the historic Western martial arts are notoriously deficient — followed or augmented by lessons at a WMA club. The reader is advised to carefully examine the instructor's own skill and reputation in the community first, as the Western martial arts entirely lack organization or official certifications. Be warned also that the serious study of the sword as a martial art is almost directly opposed to tournament success, and that should not be used as a yardstick.