How does a zerg carapace upgrade change inflicted damage on a unit? Is it worth purchasing?
The equation is very simple for armor (much simpler than Warcraft 3 for example).
Each unit has a number of attacks. Zealots for example hits 2 times for 8 damage each shot
Each unit has a number of armor points. Each armor point reduces damange by 1 by attack
Each race can upgrade armor (protoss shield works the same way). Each armor upgrade gives +1 armor.
So if a zealot would hit a zergling with carapace upgrade 1 (Total armor = 1) the calculation is as follow
Now Starcraft 2 units gets bonuses versus particular types of units
Suppose that a Viking (2x6 +8 vs armored) would try to shoot down a battlecruiser (3 armor). The calculation goes like this
So you can say that multiple hits is a weakness, since the armor gets deduced multiple times.
Now for the second part of your question, is carapace upgrade worth it? I'd say yes, but the real answer is "it depends on when to get it". Starcraft is a game of tradeoffs, so getting upgrades is good, but losing because your enemy has more units/firepower than you is bad.
The question becomes "when is it safe to upgrade?". As a rule of thumb, I'd say that whenever the game gets lengthy, that you can secure an expansion for the extra gas this cost, do it.
Zerg carapace functions the same as other races' armor upgrades, it reduces the damage taken from each incoming shot by 1 per level of carapace. Because of this it is most effective against things that do their damage in lots of smaller shots (such as marines and battlecruisers) rather than heavy-hitting units like siege tanks and ultralisks. That being said, it is usually worthwhile to upgrade your units (at least the type you plan to rely on the most) provided the game makes it to midgame or later.
Worth special mention: Zealots will kill a zergling in two hits instead of three as long as their attack upgrade is at least 1 higher than the zergling's carapace upgrade.