Some adjectives and verbs can be followed by either a gerund (-ing form) or an infinitive.
I started teaching when I was 20. OR I started to teach when I was 20.
She was proud of having won. OR She was proud to have won.
Notes
In some cases there is a difference meaning.
Remember / forget + -ing
Remember and forget are usually followed by -ing forms in the structures ‘I will never forget…ing’ or ‘I will always remember …ing’.
I will never forget winning my first national award.
I still remember buying my first car.
When remember or forget is followed by an infinitive, it usually refers to things one has or had to do at the moment of speaking.
I forgot to post the letter. (NOT I forgot posting the letter.)
Remember to call me when you arrive.
Go on
When go on is followed by an -ing form, it means ‘continue’.
He went on talking about his exploits until I went to sleep.
Regret + -ing form
Regret is followed by an -ing form when it refers back to the past.
I regret quitting my job – it was a stupid thing to do.
Regret + infinitive is usually used in announcements of bad news.
We regret to say that we cannot help you at the moment.
Advise, allow, permit and forbid
The verbs advise, allow, permit and forbid are followed by -ing forms if there is no object. If there is an object, we use an infinitive.
Compare:
We don’t allow / permit smoking in the kitchen.
We don’t allow / permit people to smoke in the kitchen.