What were the SOF/special forces of the ancient and medieval world? How precisely did their training cause them to stand out from regular armies of their time? Did such forces have the ego/esprit de corps that their elite counterparts today would have?

by KevTravels
Iphikrates

This only covers a part of the period, but I wrote an answer for Ancient Greece in this thread. In short, such forces did not exist. I doubt there are many good examples before the modern era, since the extreme specialisation and the enormous investment in time and training really only make sense in the context of modern high-tech professional militaries.