If you would like to be a math professor in the United States of America, you will need a doctorate degree in math. Community college's will hire professors with masters degrees in math only but the competition for these jobs is stiff.
To teach math at a University, you'll most likely need an advanced degree in mathematics--typically PhD. During your study years in undergraduate and graduate school you'll learn a lot about the different branches of mathematics, such as algebra, calculus, mathematical analysis, group theory, topology, number theory, ...etc, in depth, and conduct research in your area of liking. Before embarking on that long journey which is rewarding and challenging at the same time, make sure you enjoy reading and learning about mathematics, and explaining concepts to others in simpler terms they understand. If both are enjoyable to you, you're well on your way to becoming a math professor.