I'm a little confused when I read that mathematical logic is actually a very recent field (1800's - 1900's), regarding the foundations of mathematics and so on.
By this I refer to writing proofs in classical propositional logic systems (Hilbert-style, natural deduction, sequent calculus, etc), extending up to first-order logic, using that to define theories like ZFC which (to my knowledge) is largely seen as a modern-day foundation for mathematics. Likewise for Peano axioms, Peano arithmetic, and so on.
I get confused on this because haven't we been doing mathematics for thousands of years? How were we doing proofs before? How were we doing mathematics with no "foundation"?
Were we just blindly using arithmetic and real numbers and so on without really defining what they were or how they worked? Did Euler and Gauss do all their advanced number theory stuff on these informal foundations? What about Newton and Leibniz inventing calculus? All of this years before we start talking about logic and model theory? How did people convince each other that this stuff actually worked especially once we start getting into concepts like infinity?
I don't really understand the timeline of it all or why logic was such a late subject. Did we choose to formalize it so late for some specific reason? What were we trying to solve or achieve? How was it being done before? Why did it take so long before we started asking questions about mathematical foundations?