For me, it would depend on two things: the condition of the carpet and my budget.
If the carpet were in good shape, I’d probably keep it, at least for a while until I really had a good idea of how I wanted to decorate.
If I had money left after the house purchase, I might rip it up and see what was underneath. However, even with having money left, if the carpet were decent, I’d probably keep it. Going back to my first sentence, I can envision myself keeping the carpet and seeing how it goes. It would not be ideal, but I’d try to keep it and if it gets bad, then I know I can make some decisions.
If I were broke after the house purchase, I’d have no choice but to leave it, at least temporarily.