In the "before picture", areas of rotted decking were found and replaced before re-roofing.
Once old shingles have been removed, close inspection of the existing decking and supports is critical. As structural components of the roof system, they need to be capable of supporting the roof system plus the weight of stored material. If sheathing or supports are deteriorated to the point that the roof structural system is not substantial enough to support recovering, it must be either repaired or replaced. As you can see, the decking on the roof pictured was repairable, saving both time and money.
Both code and manufacturer's warranties dictate that shingles must be applied to a "nailable" surface. Therefore, applying shingles over a rotted substrate is not only unsafe, it will lessen the life span of your shingles and VOID your manufacturer's warranty.
FYI: Because a solid substrate is required by building code, when properly documented with both photos and communication, we have found that most insurance companies will pay the added cost of sheathing as long as the policy has "code upgrades" included and code is enforced in the area.