Say the US annex Mexico in 1848 and the Civil war still happens in 1861.
How US war against the CSA with Northern Mexico and reestablished Mexican republic in Southern Mexico go
I'm not entirely sure how to parse this, but I'm assuming you mean:
The US took OTL northern Mexico in the war that ended in 1848, meaning Rio Grande, Sonora, Chihuahua, Baja California, and possibly Durango/Sinaloa.
The remainder of Mexico is a separate nation called "Mexico."
In 1861, after (Rio Grande, Sonora, Chihuahua, Baja California, Alta California, Texas, New Mexico) are already absorbed into the United State, the Civil War happens.
The US and CS fight; the nation of Mexico joins the war.
If they fight on the CS side, I don't think the Union blockade can reach two nations, so both can get supplies from abroad more easily, making their war effort last longer and essentially the CS will win independence.
If they fight on the US side, the Confederates will lose. They don't have the materiel or manpower to fight a two front war. Especially with Jefferson Davis spreading their forces so thin protecting individual states, that many troops just stand idle when they could be used doing something.