CO's HKG flight arrives pretty late, so the only choice to get to Shanghai the same day is on a MU flight to PVG.
If you're fly into PEK, you have lots of choices, including flying into SHA besides PVG. SHA is closer to the city center, but if you're going to the Pudong area, then PVG will be better.
EWR-HKG is almost 2 hours longer than EWR-PEK. Which can be a good thing (more FF miles, more time to enjoy the BF seat), or a bad thing (15 hours on a plane can be painful even if you're flying BF).