The correct option is
C buying
The preposition 'in' can be used to say that something is happening, or some action is being carried out.
Option C: 'Buying' is a gerund that states an action. Here, it can be used in an interrogative sentence, where 'in' also expresses an action. Hence C is correct.
Options A and B: 'By' and 'for' are prepositions themselves. They do not create a complete meaning each, in the given sentence. Hence options A and B are incorrect.
Option D: 'To buy' is an infinitive, the base form of a verb.
When it is used in a sentence, it functions as a noun, an adjective or an adverb.
It cannot follow the preposition 'in', as it already has one preposition 'to'. Hence option D is incorrect.