"El perro no puede comer aquí."
Translation:The dog cannot eat here.
So here we don't translate comer as "to eat." Is that because eating is being spoken of as a thing rather than what the dog is doing?
Comer goes together with poder in this sentence. Since poder changes to puede then comer has to stay the same. Or when I say Yo no puedo correr = I can't run, correr doesn't change to corro
Someone with more experience, please correct me if i am wrong, but i think there is a general rule in spanish that you can't have two conjugated verbs in a row. So, since "can" is conjugated to "puede" the next verb "eat" has to remain in the infinitive form "comer". Thus you get "puede comer" which literally translates as "it can to eat". When you put it into proper english grammer it becomes "it can eat".
It would be translated as "to eat" if you translated "puede" a little differently. An alternative to the given solution could be "They are not able to eat in the library." So it's more a question of how we use "to be able to" in English than how it's used in Spanish. In Spanish, if you have a conjugated verb followed by another verb, the second verb isn't conjugated. Because "poder" is conjugated here, "comer" is not.