Note that this isn’t a necessary problem. Being around people better than you doesn’t mean you’ll do this—doing a math undergrad surrounded by better mathematicians doesn’t tend to cause people to stop learning math.
It sounds like your environment wasn’t encouraging you to work on strategic problems, just get them solved, and we could change that fact if we wanted.
Note that this isn’t a necessary problem. Being around people better than you doesn’t mean you’ll do this—doing a math undergrad surrounded by better mathematicians doesn’t tend to cause people to stop learning math.
It sounds like your environment wasn’t encouraging you to work on strategic problems, just get them solved, and we could change that fact if we wanted.