For or to + infinitive: individual purpose
For is commonly used with nouns to express individual purpose:
I popped into the supermarket for some apples on the way home.
(Not: I popped into the supermarket for buying some apples…)
I stopped by at his office for a chat about our marketing strategy.
(Not: I stopped by at his office for having a chat about marketing.)
I decided I would save up for a new computer.
(NOT: I decided I would save up for buying a new computer.)
If we want to express individual purpose with a verb pattern, we are obliged to use to + infinitive:
I stopped by at the supermarket to buy some apples on the way home.
I popped into his office to have a chat about our marketing policy.
I decided to save up to buy a new computer.
For + verb-ing: the purpose of an object
However, if we are talking about the purpose of an object or an action, we normally use the for + verb-ing pattern. Note that this pattern commonly answers the question: What are they (used) for? Compare the following:
Schools are for educating children not for entertaining them.
Schools are for learning. Life is for living.
This kitchen knife is especially useful for slicing vegetables.
What's this for? ~ It's for opening oysters. It's much better than a knife.
What's this fifty pound note for? ~ It's for buying food for the weekend.
Note that when the subject of the sentence is a person rather than the thing described, the to + infinitive pattern is also possible:
I use this small knife to slice vegetables with.
I use this gadget to open shellfish with.
In order to / so as to
Note that, as an alternative to to + infinitive, we might use in order to, or so as to, to express individual purpose when we want to be more formal or explicit about the reason for doing something. All of these structures answer the question: Why…?. Compare the following:
I went to bed early in order to get enough sleep before the exam.
After four weeks of exams, I went to the seaside to rest.
After twenty days of exams, I went to the seaside for a rest.
After all those exams, I went to the seaside so as to have a good rest.
The in order to and so as to structures are particularly useful with stative verbs such as be, have, know, appear, and before negative inifinitives:
So as not to appear foolish, I learnt all I could about the company before going for the interview.
I'm going to move to the city centre in order to be near where I work.
In order not to have to commute, she bought a flat in the town centre.
In order to know more about him, she studied his movements carefully.