The rapier actually wasn't invented until about 1540, and didn't see widespread adoption for another century. Plate armor, pollaxes, and the arquebus (gun) all predate the rapier by more than a century.
Sidearms like the sword, rapier, katana and so forth were primarily used in close quarters, or for duels; they became a symbol of the warrior aristocracy precisely because they were a specialized, expensive tool that most commoners wouldn't have. The metal-tipped spear dominated combat for more than three millennia, and for centuries the main weapons of warfare were the spear, bow, axe, mace and so forth. Medieval samurai considered the bow their primarily weapon, and used more spears and axes than sword-type weapons during their feudal era.
As we get closer to the rapier era, we see the claymore, zwiehander, and espandon type weapons dominate in actual battlefield use over lighter swords. And those are serious weapons I would consider appropriate for fighting bandits, zombies, and large monsters. A rapier, initially, wasn't that distinct from a variety of transitional weapons, but by the time you have the recognizable basket hilt, the elongated blade, and so forth, there was a strong demarcation between the rapier and martial swords. Many early fencing schools continued to teach the broadsword, longsword, and other heavy weapons well into the 16th century, because they were more typical martial weapons.
The term rapier comes from the Spanish ropera, literally a sword for dressing. It was a semi-insulting term but also referred to the fact it was a sword suitable for a gentlemen to wear when about, in case defense or honor were at stake.