Shanghai warned children and the elderly to stay indoors for a second day as haze engulfed the city, sending PM2.5 levels to more than 9 times the World Health Organization’s recommended exposure.