I hope this doesn't come across negatively, but a quick reddit search of the AskHistorians sub will find several instances of this question having already been asked.
Direct link to search:
I think it's answered rather well here: https://www.reddit.com/r/AskHistorians/comments/20t22m/how_did_it_come_about_that_men_wear_pants_and/