When do I put à or de before an infinitive?
I know that when I'm saying "I have nothing to do," it is "Je n'ai rien à faire," but why don't I say "Je n'ai rien faire?" That is the literal translation? When do I put à or de before an infinitive?
One thing that's helped is to realize that it's the first verb or word that determines which preposition (or lack thereof) goes after it regardless of which infinitive follows. These chunks have to be memorized.
These are general and not specific to your particular question, but can help get you started:
à is being triggered here because you have an infinitive following the verb "avoir".
J'ai à parler → I have to speak
Tu n'as pas à aider → You don't have to help
Elles n'ont rien à dire → They have nothing to say
See this great list: