Hi,
From above, "to" is a preposition, not infinitive.
Yes.
How do I tell the difference between " to infinitive and to gerund " ?? To answer your question directly, a gerund ends in -ing but an infinitive does not.
However, perhaps you are really asking 'How do I know when to use an infinitive and when to use a gerund?' I think a practical answer is that, as you get used to speaking a lot of English, you simply become familiar with phrases like this.
Best wishes, Clive