正如你觀察得到,to之後未必要用infinitive,因為許多情況下,只要to是preposition,那時就要用名詞或動名詞,如:
I was used to studying late.
He devoted himself to writing.
若要想知某個動詞後面的to應該用infintive或gerund,只要我們先將一個名詞放在to後面,而文法仍然正確,那個to後面就是用動名詞,如:
He told me to market.(就不合文法,所以這to要用infinitve,像:He told me to go)
而I am looking forward to your letter.(文法是正確,所以可用動名詞)
Some verbs need to follow by 'to infinitive'
some verbs must be followed by gerund.
There is another question concerning gerund being asked in Yahoo knowledge before and the answer is more complete than the above 2 answers.
Please search the question by yourself.