If I remember correctly, pants were invented to protect the legs during horseback riding.
Probably. I think people wore tunics before pants, or before breeches and codpieces.