This functionless, decorative, least comfortable of mens attire is of military origin.
The first recorded neckwear appeared in the first century B.C. In the heat of day, Roman soliders wore focale- scarves soaked in water and wrapped around the neck to cool down the body. This completely utilitarian garment, however, never caught on sufficiently- in either a practical or a decorative sense- to become a standard article of menswear.
The origin of the modern necktie is traceable to another military custom.
In 1668, a regiment of Croatian mercenaries in the service of Austria appeared in France wearing linen and muslin scarves about their necks. Whether the scarves were once functional, as were focale, or merely a decorative accent to an otherwise bland military uniform, has never been established. History does record that fashion conscious French men and women were greatly taken with the idea. They began to appear in public wearing neckwear of linen and lace, knotted in the center, with long flowing ends. The French called the ties cravats, their name for the “Croats” who inspired the sartorial flair.
from: Extraordinary Origins of Everyday Things by: Charles Panati