The correct answer is A) "My mother went to the grocery store to buy food for our upcoming camping trip."
The infinive phrase has different functions within a sentence. In this case, the infinitive phrase "to buy food" is acting as an adverb since it is answering why the mother went to the grocery store.
Option B) is grammatically incorrect as it uses "for" followed by "to buy".