It is far more discouraging when an old, white guy teacher (me, something I've done occasionally, but not now) overhears one student telling another to stop doing well in school because it's "too white" to do that. Old white guy (me) has no answer, no approach for helping at all. Anything I might say would be "racist".
I've mentioned the problem to black colleagues and black parents, as well as to black students, and none of them had any good answers, either.
The standard student difficulty of "hating" mathematics comes directly from not working each problem, alone or with little help from others. That's something I CAN help with, giving suggestions but never the answer. Some math students get pushed ahead of their current abilities and are stuck. You can't do fractions unless you have subtraction and division working thoroughly, inside your head.