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...