The choice between "for gerund" and "to infinitive"

In 4. both are valid sentences, but they don't mean the same thing.

They bought a stove to cook food. This was their purpose in buying a stove.

They bought a stove for cooking food. This was the kind of stove they bought.


The difference is that "for"+gerund is used to qualify a noun-phrase, whereas an infinitival can (and in your examples does) qualify a verb-phrase (as a purpose-adjunct).

So, in (5), we can have strawberries for producing jam, but the infelicity arises because you have structured the sentence as if you intend "for producing jam" as the reason for sending strawberries there, i.e. as if you intend it to modify the VP.

Similarly, (4) is fine if we take "for cooking food" as modifying the NP "oven", but not the VP "bought an oven".

(2) and (3) are wrong because there is no NP to modify (you can't use the pronominal subject).

(1) is correct only because "question" is read as a noun, and a for+NP preposition-phrase can certainly function as VP-modifier. (E.g. we can send strawberries there for the production of jam, or buy an oven for the purpose of cooking food.) But if we force it to be read as a gerund by adding a complement (They took her to the warehouse for questioning her son), it is clearly bad English.

It isn't necessary to touch on issues such as whether the infinitival is functioning as relative clause (which it isn't, in your examples, but would be in an example like "an oven to cook food with") or what the infinitival subject is (in your examples it always inherits the matrix-subject, though its subject is the matrix object in an example like "I took her there to see the view").