I have seen a number of reports and pictures of the current problems in Shanghai due to air quality. Is it dangerous enough that I should stay away? I am scheduled to spend three days there teaching a course indoors.
TL;DR: I wouldn't cancel a three-day trip because of the current spike.
Over numerous trips to China I have found that the claims re the effect of air quality seem to be excessively alarmist. If you are asthmatic or similar it is not liable to cause major problems - and asthmatics usually have the knowledge and experience and medication to handle occasional bad events.
Note that these are claimed to be accurate real-time results BUT I have no ideas whether they are in fact "cooked".
PM2.5 is shown here as 159 (ug/m^3) and has had a range of 129-492 in the last 2 days. International limits vary by country but 50 to 100 is typically the long term acceptable limit.
I've been in numerous Chinese cities when the air was vastly affected by pollution without being troubled by it at all. Others are less lucky. For a period of only 3 days I'd expect it to not be a major issue.