No specific law on the matter in any state I am aware of.
It must be 'habitable' i.e. not so stained, damaged, smelly or unsanitary as to make the apartment uninhabitable if LL is to avoid being sued for failing in a duty.
Dear I just need to know?
There is no law on the subject. If you are the tenant of a furnished room or apartment, and the carpet is worn or threadbare, and you believe that the furnishings included the carpet and you want your landlord to replace the carpet, you could request that he do so.
Or, if you receive permission from the landlord you could replace at your own expense.
Likely, the carpet will become the landlord's property and you would not be able to remove the carpet when you move.