A rapier, also known as a foil, was a sharpened, pointed, thin sword used for attack and defense.
While infected by the polywater intoxication in 2266, Sulu chased a number of crew members with a rapier before being subdued by Spock. (TOS: "The Naked Time")
Captain Jean-Luc Picard used a foil during his fencing matches aboard the USS Enterprise-D against Guinan, Lieutenant Dean, and Commander Riker. (TNG: "We'll Always Have Paris", "I Borg", "Lessons")
In 2366, while "playing" Reginald Barclay's holodeck version of The Three Musketeers, the characters played by Data, Captain Picard, Geordi La Forge, and Commander Riker used rapiers for their sword fight with Barclay. (TNG: "Hollow Pursuits")
Data kept a rapier in his quarters, stored in a shelf. (TNG: "Timescape")
Captain Kathryn Janeway also kept a rapier in her quarters. It was located on her dresser alongside one of her reading chairs. (VOY: "Persistence of Vision")