I got a B in my math class as a freshman, now I feel like I am not as smart as all of the other 4.0 kids

Freshman year is the best year to get Bs.

You could do the mature thing and do some introspection or go to therapy and develop a sense of self that doesn’t depend on being the smart kid… Or you could just put a bandaid on things by grinding for the PSAT or even the AMC and assuaging your bruised ego with a higher math score than the other 4.0 kids. That should hold you off until you meet a higher scorer.