Whether you have to pay for the carpet depends on whether it is a sublease. From what you said, it is impossible to figure out whether you were in a lease or assignment or sublease. Who was the tenant when you leased? Did you return the apartment to the tenant or to the landlord?
A sublease is an estate carved out of a lease term but short than the lease term and the head tenant retains a reverter. As a subleasee you are not in privity with the landlord so that you have no obligation for anything, not even pay the rent, although you can be held liable for tortious damage to the property. Your obligation is to the head tenant, not the landlord.
From what you said, it sounds like a periodic tenancy so that you are liable to the landlord, although I think asking you to pay a brand new carpet after living there for only two months is very unreasonable, unless you left the stain there.
A sublease is an estate carved out of a lease term but short than the lease term and the head tenant retains a reverter. As a subleasee you are not in privity with the landlord so that you have no obligation for anything, not even pay the rent, although you can be held liable for tortious damage to the property. Your obligation is to the head tenant, not the landlord.
From what you said, it sounds like a periodic tenancy so that you are liable to the landlord, although I think asking you to pay a brand new carpet after living there for only two months is very unreasonable, unless you left the stain there.