The term refers to a variety of blade and hilt forms depending on who is writing and when, is can refer to earlier sideswords (much like the espada robera") through the high rapier period of the 17th century through the small and duelling swords, thus context is important in understanding what is meant by the word.
The rapier began to develop at around 1500 as the Spanish "espada ropera," or "dress sword." The espada ropera was a cut-and-thrust civilian weapon for self-defense and the duel, while earlier weapons were equally at home on the battlefield. As a result of the geometrical theories of such masters as Camillo Agrippa and Ridolfo Capo Ferro[?], the rapier developed, by the year 1600, into a primarily thrusting weapon.
The rapier became extremely fashionable throughout Europe with the wealthier classes, but was not without its detractors. Some people, such as George Silver disapproved of its technical potential and the duelling used to which it was put.
While the by the year 1700 the rapier had been replaced by the lighter smallsword throughout most of Europe, this weapon is probably the oldest European sword that still has a living tradition; that is, fencing masters exist that can trace their lineage of teachers back to the 18th century and before. Two of the most famous of these current-day masters are Maestro Ramon Martinez and Maestro Andrea Lupo Sinclair. Others have learned from these maestri, and currently Europe and America are interested experiencing a revivial of historical fencing.
The rapier is also the sword most often associated with duels of honor depicted in literature and movies, such as The Three Musketeers. However, such films are often far from authentic, so far as the fighting techniques shown go.
For a more detailed explanation of the primary use of the rapier-- dueling-- see European dueling sword.