Will it be "je ne dois rien acheter" or "je ne dois rien de acheter"? Thanks
“Je ne dois rien acheter” is correct. It means that I must not buy anything, i.e. if I buy something, it would be wrong.
“Je dois ne rien acheter” is also correct, but rare. The meaning is slightly different, because it treats “to buy nothing” as an action which must be performed. It's a form of emphasis on the effort that has to be made to buy nothing.
Je ne dois rien de acheter” is wrong. There's no way to fit the word de here.
To translate “I don't have to buy something”, i.e. I am not obliged to buy anything, you can say “je ne suis pas obligé d'acheter quelque chose” or “je ne dois pas forcément acheter quelque chose” (this one conveys that there was a presumption that I did in fact need to buy something) or “je n'ai rien à acheter”.
Between your choice of sentences, "je ne dois rien acheter" would be the right one.
But I'm not sure if it's what you mean : this means that you should not buy anything. Because you have to pay for rent, for example.
If you just mean that you have no need to buy anything right now, you could say "Je n'ai rien à acheter".