Umm...If nukes weren't a deterrent, why would NK, Iran (okay, Iran might actually want to use them), and a slew of tin pot dictatorships want to procure them, even in small amounts? You're right that Red China would think of that as a declaration of war, but it definitely serves a purpose. The Chicoms are pretty fervent about taking Taiwan, but having the possibility of a radioactive Beijing, Shanghai, or any big city is certainly going to influence whether they try and take the island by force.
What you say is certainly true, but the problem is that Taiwan doesn't have the means of delivering a nuke to Shanghai or Beijing. Taiwan is in the south, it only has missile capabilities of reaching Fujian province, which is mostly rural.