This is a great question and has been discussed at great length among mathematicians and mathematics educators. Research shows that the ability to do mathematics at a level, corresponding to the middle school mathematics curriculum (Common Core State Standards) is accessible to almost anyone with enough interest and dedication. One example is provided by the true story of Jamie Escalante that was made into the movie, Stand and Deliver.
In 1974, a 43-year-old, feisty mathematics and physics teacher from Bolivia, named Jaime Escalante, came to teach at Garfield High School in a poor area of East Los Angeles. In the mid-1960’s, permissive school administrators had relinquished control and allowed predominantly Latino street gangs to stake out their territories with “placas” on school property. The student dropout rate had reached 55% and the poor academic performance of the students had put Garfield at risk of losing its accreditation. Teachers were told to prepare courses appropriate for poorly performing students. However, Jaime made an interesting assumption: these students, in spite of their poor background, might be capable of mastering the most challenging mathematics course in high school–AP Calculus (Advanced Placement). After 4 years of unrelenting effort, Escalante secured the support of his Principal and the Advanced Placement Coordinator to test his assumption. Garfield would offer the AP Calculus course and Jaime would teach it. In that year he recruited 5 students and 2 passed the course. By 1981, 14 of the 15 students in his AP Calculus class passed the challenging AP Calculus examination. The passionate coach would ask his students, “Where is the money?” Responding to their blank stares, he would say:
The money is in chemistry, physics, computers, electronics,’…I’ll teach you math and that’s your language. With that, you’re going to make it. You’re going to college and sit in the first row, not the back because you’re going to know more than anybody.
The next year, when 18 of his students passed the examination, the Educational Testing Service at Princeton, that creates and monitors the AP courses, became suspicious of the test results and had a dozen of Jaime’s students take another test. All the students passed, validating the previous results.
During the part of my career that I spent in mathematics education, I discovered that most students who fail at mathematics do so out lack of interest, effort or belief in their ability. Mathematics at the high school level is accessible to almost all, but it is a discipline like physical conditioning and it requires significant dedication, and that’s why a significant portion of our population is mathematically illiterate. So the short answer to the question is that mathematics at the high school level can be mastered by almost all people with sufficient effort, although your genetics will influence how much effort you will need to expend.
However, when we look at mathematics at the highest levels, a person’s genetic gifts play a major role in their ability to advance the frontiers of mathematical knowledge. Terrence Tao displayed exceptional gifts at an early age and Ravi Vakil, President Elect of the American Mathematical Society, dominated mathematical competitions during the early part of his career. Such people process ideas very quickly, enabling them to problem solve at the highest levels. Jeff Bezos, founder of Amazon was identified as gifted early in his career and enrolled in Princeton to follow in Einstein’s footsteps. However, a career-changing moment in Jeff’s life suggested that he might not be the brightest of the bright in mathematics. Biographer Mark Leibovich writes:
One night during his freshman year, [Jeff] was struggling over a partial differential equation he had to complete for a quantum mechanics class. After a few hours of frustration, he and his study partner visited the dorm room of a classmate, who glanced at the equation and said, “Cosine.”
“After we expressed some incredulousness,” [Jeff] says, “he proceeded to draw three pages of equations that flowed through and showed that it was cosine.” It led to a realization: There were people whose brains were wired to process abstract concepts in a very graceful way, and he [Jeff] was not one of those people. “It was initially devastating,” he says, “very, very, troubling.”
This epiphany prompted Jeff to re-direct his focus. He changed his major to electrical engineering and computer science where he graduated summa cum laude in 1986 with a B.S.E. degree in electrical engineering and computer science. The rest is history. So, the good news is that your genes are sufficient to enable you to learn mathematics at a functional level, though not necessarily sufficient to advance the frontiers of mathematical research.