The correct option is C Why / to buy
We use the interrogative pronoun "why" to enquire about a purpose, here the purpose for going to the chemists. The infinitive (to+ root verb) is used to express a purpose, here, to buy some medicine. Hence, Option B is correct. The rest of the options do not adhere to this rule, hence incorrect.