I want to answer it anyway.
The best strategy if you're planning to sell your property is to get rid of as many blemishes the property presents as to avoid having to negotiate down your asking price with any potential buyer.
Fix it, then price it to sell if that's what you want. Good Luck!
This type of question comes up often when listing homes. There are those of us that are left-brain and those of us that are right-brained. Bottom line is if you don't replace it and offer an allowance, half of your perspective Buyers will be able to envision the home with new carpet and that's fine, however, the other half of your perspective Buyers will not be able to envision it, and will only see the old "I need to be replaced" carpet. If you are dedicated to selling, get it in tip-top shape before you list!
I hope that helps explain why you should.......
I am from your area so I know that Palo Alto has always commanded good prices. But, even given that, by taking the time to get your home in order, at probably little expense, you will truly be able to maximize your asking price.