How has mathematics been done historically? [Book Reference Request] I know the original question title "what is the foundation of mathematics really?" seems pretty bad, or extremely bad, since it's really a huge question to answer. And I totally accept the fact that someone is going to disapprove this question.
But I have to ask this question anyway, the curiosity, or more kind of like pain, is killing me since it really has been bothering me for a very long period of time.
What is the foundation of mathematics really? Or the other way to state this question is like how those people lived in the past studied mathematics really?
I mean come on, I know nowadays people start to learn math from their elementary school doing simple things like addition or subtraction that sort of Arithmetics stuff, and as they move to middle school or high school, they start to learn geometry, or pre-calculus.
But in my perspective, these contents, or this path of learning math, is purely just a highly condensed abstraction that those people in education field designed that way. I have high confidence to assert that this can't be the way how people in the past learned math. By saying people in the past, I am really talking about peole in the past, like two or three hundred years ago. Moreover, to the very beginning of human kind.
I have done some researches on my own, and it seems like the foundation of modern mathematics is Euclid's elements, this reference is pretty much the one that I can find that looks like the very beginning of math to me. I am wondering if someone can recommend some references like Euclid's elements this sort of "very-beginning-of-math" to me.
Sincerely appreciated. 
 A: Victor Katz's A History of Mathematics does a pretty good job at tracing how some of our modern notions were developed, and sometimes how these things were conceptualized at the time and place.  He gets a bit technical at times, being in an awkward spot between writing a history book and writing mathematics.  But overall, I think it provides some of the context you're looking for, starting with Mesopotamian mathematics.
Of course, it's difficult to say definitively that such-and-such is definitively how they were thinking in comparison to now.  So often enough the best we can do is instead describe how mathematics was used and taught.  Lots of mathematics in the ancient world isn't based on proof but on algorithm or learned by example, where it seems expected that you follow and can generalize. Things are often stated in physical terms and appeal to intuition, being related to constructions, farm yields, and other things that ancient civilizations understandably prioritized.
Katz also goes into later mathematics in the later chapters, at first focusing on the development of calculus, but also touching on later developments and understandings of algebra, complex analysis, geometry, and a bit of logic and arithmetic.  Part four of the book, for example, has chapters called "Analysis in the Eighteenth Century", "Algebra and Number theory in the Nineteenth Century", and "Aspects of the Twentieth Century and Beyond".  The book more or less tries to follow a chronological telling, but obviously this isn't completely possible with things happening concurrently.
A: Your question is not fully clear to me. It's not clear whether you are asking about math education or the foundation of mathematics, which is different.
As far as I know, in the past, learning math was basically studying Euclid's elements(at least in the west).
Now with regards to the foundation of mathematics. Euclid's elements is not the foundation of mathematics, what Euclid did was to organize all the mathematical knowledge of his time(specially geometry) in an axiomatic way, Euclid was the first person to do this(again, as far as I know), his work is not perfect and it contains logical flaws, but it is impressive, and it is totally worth studying it.
As of the current foundation of mathematics, it's mainly zfc set theory(again as far as I know, I'm not an expert).
There are a lot of books about foundation of math, some of them are more philosophical than mathematical, so it depends on your interests, questions like "what is a number?" is more of a philosophical question than mathematical. A great book that I'm currently studying is  Introduction to the foundations of mathematics by Raymond L. Wilder, I totally recommend it, besides, it's free, you can find it in archive.org
The other book that comes to mind is introduction to the philosophy of mathematics by Russell.
A: If you want a brief overview about the history and development/evolution of mathematics throught the ages around the world there
are some sides in the web like this one:https://www.storyofmathematics.com
"Probably intended for a general audience not academics only"
For early Mathematics in the Ancient Middle East you might check 
the book "A Remarkable Collection of Babylonian Mathematical Texts(Springer 2007)"
published by author Jöran Friberg.
From Ancient Greek Mathematics there are some original textbooks that have
been preserved and edited like "Euclid's Elements" the standard textbook of Ancient
Greek mathematics which is the best known one,some works by Diophantos and the treatise
on Conic Sections by Appolonius most notable(i think) are the versions edited and commented
by Author John Heath.
Then Descarte's Geometry is also worth taking a look at.
Then there is a classic historical Chinese Math textbook called 
Nine Chapters on the Mathematical Art.
About Indian Mathematics you find information at the side i posted at the beginning
i don't know if there exist modern translations of classical Indian math texts though
A: There's a difference between the questions:


*

*How did people used to learn math?

*What is the foundation of math?


For (1), the answer is roughly: before computers, people learned math from books, school, university courses, and from whatever experts they had access to - their parents, their teachers, friends of the family, etc. Most people's approach was ad hoc, learning things as necessary, updating their point of view where needed. They would seek to create, not the ship straightaway, but an ongoing project to construct and reconstruct the ship to sail further and further into deeper waters. And honestly, not much as changed. Our approach to math is still rooted in this incremental, ad-hoc approach I just described. Math education theorists basically say: "Expose the student and give them some tasks, then expose them some more and give them more tasks, then expose them even more with some further tasks. Eventually they will get there."
For what it's worth, I largely disagree with this approach. In my opinion, we should be creating software that allows both novices and experts to get started doing formalized mathematics right from the early days. I'm not saying we should go crazy, and ask Year 1 students to do programming and formalized mathematics before they can even multiply numbers properly. I am saying that we should ask Year 3 students to do programming and formalized mathematics. Good software doesn't restrict people, it aids them. This is the path that I think we need to go down.
For (2), note that Euclid's elements is definitely not a foundation of math in any meaningful sense of the word, because it only deals with plane geometry.
The currently "standard" foundation of math is called ZFC. You can learn about it from Goldrei's excellent Classic Set Theory.
An alternative framework that arguably fits better with the modern categorical viewpoint is called constructive type theory. You may also be interested in Vladmir Voevodsky's Univalent Foundations program. Under Voevodsky's proposal, these very fundamental objects called $\infty$-groupoids that are very hard to reason about in classical foundations become much easier to use, which makes his program very appealing.
Be sure to check out Coq and Lean if you're interested in computer-formalized mathematics.
Also be sure to read up about the Brouwer-Hilbert controversy, which was a debate about the question: "If I want to prove $\varphi$, is it enough to assume $\neg \varphi$ and derive a contradiction?"
Other approaches you might be interested in include SEAR and NFU.
However, in my opinion, all of the above approaches are fundamentally very unpleasant. In particular, my opinion is that all the above approaches ignore the fundamental insight of category theory, namely that composition is more fundamental than evaluation. I'm also dissatisfied with existing ideas about how math and programming are connected. Surely the real connections are deeper and cleaner than anything we currently understand. Long story short, I think we're still waiting for a final framework. Eventually a maximally beautiful framework may come to light. For now, wandering around in half-lit caverns will have to do.
