Meh, sometimes. I battle about... 80% of the trainers? Maybe 85%? Usually I'll battle them, but occasionally I want to get on with the plot so just skip them, then sometimes come back later to battle them and sometimes just don't bother. (And so on occasion, after I beat the game, I'll be zooming along with my level 50+ team and suddenly be stopped to battle by some cocky kid that I missed, with three level 12 Pokémon.) I'm more likely to skip trainers when I know the approximate level of the next gym leader's Pokémon and know that my team's several levels above that.
There are a couple of exceptions to this: I always battle every member of Team Whatever and I always battle every trainer in a gym, even if I don't have to.