Not reading the entire post I will respond to soem of the earlier ones.
If I remember right, both battles fought between Rome and Macedonia, the Macedonians had the upper hand until they reached broken ground, at whcih point holes formed in the lines which the Romans exploited. There is no way the Romans could have done what they did to a Alexander led Macedonian army. Hannibal and Alexander were very similar in that regard. Hannibal understood the value of Heavy ifnantry and calvary used together. The battle Hannibal lost, he did not have the same resources and calvary that he had in previous campaigns were he had been so succesful.
Well, Romans utterly destroyed phalanx many times. Many times when they fought against the Seleucids and Carthaginians.
The Roman tactics, however, were not only in the battlefield, so you can't say "if Hannibal had his cavalry Numidian cavalry troops he would have been victorius"... Roman tactics were also political, logistical and other types... Hannibal lost.
The Roman heavy infantry was made obsolete by Horse Archers, which dominated the battlefield and replaced Heavy Infantry as the primary tool of Military leaders.

Horse archers did not make Roman infantry obsolete, and it did not replace heavy infantry!
First of all, horse archers were very expensive. They did not require a lot of costly armour, but they did require training, very much training. To fire a bow from horseback and to do it effectivly required masterful horsemanship, and when the horse still moves, and you have to fire...

this is why Europeans abandoned horse archery.
Now, when combined with standing archers, heavy infantry can deal with horse archers.
Parthians did not win Romans because of their horse archers, they won because they had enough resources and men to hold back the Romans.
The Legionarre were especially adept at repelling calvary charges. Heavy calvary was used for one purpose...shock. A diciplined block of dense infantry could withstand the shock impact of a Calvary charge.
The success of a Heavy Calvary charge hinged on breaking the enemy formation and driving through and breaking them, cutting them down as they broke. Kataphracts and Midevil knights had very similar mass, and therefore had similar shock effects.
Later Legionarres carred a different type of Pilum, in addition to the type that were ment to be thrown.
No, late Roman legionaries used the Kontos, which was a pike-like weapon devopled from a lance, if they faced cavalry armies. Roman legionaries carried javelins and the Plumabatarii carried small, deadly darts which could be carried tetached to the back of their shield.
There were several reported cases of calvary being driven off by Legionarres using the throwing type of Pilum as well.
Maybe, but they probably used the
Contos
Once Horse Archers started to dominate the battlefield, the Romans were forced to adapt,
When did the horse archers dominate the battlefield? The Goths didn't use them, Germanics didn't use them, Vandals didn't use them, Sassanids reduced their use significantly ETC.
Only Huns, Sarmantians and some other steppe peoples used horse archers in mass. This is why Romans didn't train horse archers in large scale.
and the days of Heavy infnatry dominating the battlefield were over for a time. Next came the domination of Heavy Calvary, and then Heavy shock infantry made a return.
Well, Romans didn't start to train cavalry, in even more larger scale then before, because they couldn't beat the enemy enemies. They trained them because they needed more mobile armies to counter the Germanic mobile armies.
The infantry was made more lighter, so it could march faster and could run with the heavy cavalry. The Romans, BTW, took this tactic in to use before they started to face the steppe cavalrymen.
Roman infantry was not made obsolete by the heavy cavalry, Roman infantry continiued to be very important part of the army and very successful.