1. Boys are better at math than girls.

2. He is the best at math of all the students in his class.
(Are both grammatical?)

Both are grammatically correct, yes.

I don't think 1 is a true statement, though! I know plenty of girls and women who are excellent at math, including my younger granddaughter!

Yes, both sentences are grammatically correct. However, it is important to note that the first sentence reflects a commonly held stereotype that is not necessarily true. Research has shown that there is no innate difference in mathematical abilities between boys and girls. It is essential to avoid perpetuating stereotypes and acknowledging that individuals' math abilities can vary regardless of their gender.

As for the second sentence, it is grammatically correct and means that the person mentioned is the most skilled or talented in mathematics among all the students in their class.