The answer to 'when to replace underlayment' is that you should typically replace your roof underlayment every 20-30 years, or whenever you replace your roof. Roof underlayment is the protective layer installed beneath the roof shingles, and it helps prevent water damage and provide a stable base for the shingles. Over time, the underlayment can deteriorate due to weather, UV exposure, and other factors, making it less effective at protecting your roof.
If your roof is older than 20 years, or if you notice signs of wear and tear on the underlayment, such as cracking, curling, or discoloration, it's a good idea to have a professional roofing contractor inspect the underlayment and determine if it needs to be replaced. Replacing the underlayment can help extend the life of your roof and prevent costly water damage to your home.