History of (proposal of) set-theoretic foundations It is often said that set theory is the de facto foundation of mathematics. Regardless of the truth of this claim, this seems to be the story told to students (and mathematicians) who poke their elders about foundations.
Before I proceed, let me explicitly state that, in this MO question, I am not interested in

*

*whether set theory is indeed the foundation of mathematics, or

*whether set theory should serve as the foundation of mathematics, or

*whether set theory is superior or inferior to other possible foundations such as type theory etc.

What I am interested in is the historical reasons of why set theory has been seen as the unifying foundational framework in the first place. My questions are uncontroversial ones with (hopefully) definite answers:

Who proposed first that mathematics can/should be based on set-theoretic foundations? How did the mathematical community come to accept this?

Let me now explain why I am interested in this question and then list my two findings.
Mathematicians who are not logicians often consider set theory only as a foundational framework. This point of view seems to be somewhat irrelevant to the point of view of a uniformly chosen set theorist who usually sees set theory as the study of the transfinite and the structure of hierarchy of sets. Clearly, such investigations may have foundational implications and therefore, may be of importance even if one only adopts the first point of view.
Nevertheless, as far as I can tell, the development of set theory does not seem to be fuelled by its foundational role. For example, in this article by Kanamori, there are several places where he alludes to this:

Set theory had its beginnings not as some abstract foundation for
mathematics but rather as a setting for the articulation and solution
of the Continuum Problem: to determine whether there are more than two
powers embedded in the continuum.
With ordinals and replacement, set theory continued its shift away
from pretensions of a general foundation to a more specific theory of
the transfinite, a process fueled by the incorporation of
well-foundedness.
From Skolem relativism to Cohen relativism the role of set theory for
mathematics would become even more evidently one of an open-ended
framework rather than an elucidating foundation.

Assuming that all these claims hold, it seems surprising (and almost contradictory) that mathematicians of a certain era, most of whom are presumably not even knowledgeable about set theory, decided to play along and accept set-theoretic foundations. This is why I would like to know about the history of this process. Here are what I learned through a Twitter discussion with Kameryn Williams:
In a 1949 ASL address, Bourbaki writes the following on Page 7:

As every one knows, all mathematical theories can be considered as
extensions of the general theory of sets, so that, in order to clarify
my position as to the foundations of mathematics, it only remains for
me to state the axioms which I use for that theory.

It seems that theory of sets being able to code all mathematical theories was a "well-known fact" by 1949. In this SEP article, at the beginning of Section 3, José Ferreirós stated (without reference, but echoing chapter III, section 4 of his 1999 book) that

In the late nineteenth century, it was a widespread idea that pure
mathematics is nothing but an elaborate form of arithmetic. Thus it
was usual to talk about the “arithmetisation” of mathematics, and how
it had brought about the highest standards of rigor. With Dedekind and
Hilbert, this viewpoint led to the idea of grounding all of pure
mathematics in set theory. The most difficult steps in bringing forth
this viewpoint had been the establishment of a theory of the real
numbers, and a set-theoretic reduction of the natural numbers. Both
problems had been solved by the work of Cantor and Dedekind.

Thus the earliest proposal of set-theoretic foundations may even date back to pre-ZFC era. Unfortunately, since I do not know any German, I couldn't track down the aforementioned work of Dedekind and Hilbert. According to this SEP article, they seem to be the prime suspects but I have no other sources.
 A: To Timothy Chow - G.H. Hardy's "A Course of Pure Mathematics" (first edition 1908, 2nd edition 1914, so before Russell was writing) included integration, differentiation, Taylor series, the Heine-Borel theorem and more. So I don't think analysis was regarded as "applied". Hardy was writing for (bright) first-year students, so he doesn't stress the foundational aspects, but he defines a real number as a Dedekind cut in the rationals and then proceeds to define addition, multiplication, etc, of real numbers in terms of operations on sets of rational numbers.
The third edition of Hardy's book is available online at https://www.gutenberg.org/files/38769/38769-pdf.pdf. The preface to the third edition states that "no extensive changes have been made in this edition", so we can take it as a good approximation to the 1914 edition.
A: Not a complete answer, but maybe relevant.
Russell, in Introduction to Mathematical Philosophy (1919) simply states the Peano axioms are the foundations of math without much discussion.

Having reduced all traditional pure mathematics to the theory of the natural numbers, the next step in logical analysis was to reduce this theory itself to the smallest set of premisses and undefined terms from which it could be derived. This work was accomplished by Peano. He showed that the entire theory of the natural numbers could be derived from three primitive ideas and five primitive propositions in addition to those of pure logic. These three ideas and five propositions thus became, as it were, hostages for the whole of traditional pure mathematics. If they could be defined and proved in terms of others, so could all pure mathematics.

He then goes on to talk about classes in terms of sets in chapter 2.
A: I'm not sure why you expect there to be a crisp answer to such a broad question.  The SEP article you cited demonstrates that, like most historical questions, the answer is messy and complicated.
Your question uses the term mathematics in what might be a slightly anachronistic manner.  I gather that when you speak of mathematics you view mathematics as a unified totality, capable of being put on a single foundation.  The only question is whether set theory should be chosen as that foundation, not whether it makes sense to talk about a foundation for all of mathematics.  But by framing the question that way, you're already conceptualizing things in a way that came rather late in the story.  In the 19th century, people would talk about the foundations of geometry, or the foundations of analysis, or the foundations of arithmetic.  Particularly in the case of analysis, but also in the case of geometry, people latched onto set-theoretic ideas.  So in some sense, set theory was already regarded as a foundational tool back then.  But if you're asking when it was first conceived that axioms for set theory could be laid down, and that these axioms could be used as a foundation for all mathematics, that development arguably didn't happen until Zermelo.  On the other hand, by the time of Zermelo, the general concept of set theory playing a foundational role had already been floating around for a while.  So again, I don't think there is a crisp answer to the question in the way you've formulated it.
A: See Second Amplification (9/7/22).
Through the work of Cantor, Dedekind, Weierstrass and others, analysis was placed on a naive (non-axiomatic) set-theoretic foundation. With the discovery of the set-theoretic paradoxes, however, that foundation was called into question and the search for an adequate foundation was taken up. Of the various alternatives that arose, axiomatic set theory emerged as the most popular. The idea that axiomatic set theory provides a foundation for all of mathematics evolved from the role it was perceived to play for analysis.
Edit (Amplification).
In Zermelo's paper of 1908 concerned with the axiomatization of set theory he does not describe set theory as a foundation for mathematics, but rather "as an indispensable component of the science of mathematics" due to the role it plays in investigating, "number, order and function". However, by 1922 the situation was quite different. Indeed, in the paper Some Remarks on Axiomatized Set Theory, the paper in which T. Skolem drew attention to some of the limitations of Zermelo's axioms, he observed that: “…in recent times I have seen to my surprise that so many mathematicians think that these axioms of set theory provide the ideal foundation of mathematics; therefore it seemed to me the time had come to publish a critique.” (T. Skolem, Some Remarks on Axiomatized Set Theory in From Frege to Gödel, Edited by Jean van Heijenoort, p. 301).
Second Edit (Further Amplification).
By 1927 Zermelo-Fraenkel set theory was in place and it soon came to be widely viewed as the foundational framework that Skolem
observed many had originally attributed to Zermelo’s theory. It was against this backdrop that Kurt Gödel began his momentous incompleteness
paper (submitted in November 1930 and published in 1931) as follows:
The development of mathematics toward greater precision has led, as is well known, to the formalization of large tracts of it, so that one can prove any theorem
using nothing but a few mechanical rules. The most comprehensive formal systems that have been set up hitherto are the system of Principia Mathematica on the one hand and
The Zermelo-Fraenkel axiom system of set theory (further developed by J. von Neumann) on the other. These two systems are so comprehensive that in them
all methods of proof today used in mathematics are formalized, that is, reduced to a few axioms and rules of inference. (On Formally Undecidable Propositions of Principia Mathematica
And Related Systems in From Frege to Gödel pp. 596-597.)
A: I don't currently have access to an academic library to give good references, but I can talk about this a little bit.  It all has to do with Calculus and applications (especially differential equations, and maybe stuff like analytic number theory).
Basically, the 1400s to 1700s were like the wild west of mathematics.  Mathematicians used lots of cute tricks that "seemed" to work, but for which their true validity was unknown.  Notions like infinity were not clear.  Even the natural numbers were not defined in a "rigorous" way.
Weierstrass's epsilons and deltas helped, but it basically ignored the question of infinity (by hiding them behind the limits of sequences).
Questions of infinity were problematic, because depending on what you "do" when you "reach" an infinity, you can get different models of an object.  (This wasn't exactly clear at the time, but Brouwer was asking the right questions, at least)
And then came Joseph Fourier, who wanted to add up infinitely many sine waves to approximate any continuous periodic function.  His work was rejected, basically because it was so far removed from the foundations that the mathematicians of the time were comfortable with (i.e., the bag of tricks they trusted).
But at the same time, people really really wanted Fourier analysis to work.
So there was a period of great interest in foundations, which ultimately lead to Cantor's naive set theory, and then a theory of measurability and those aspects of real analysis, and ultimately the "modern" set theory where the property of the basic objects are pushed to their limits (sets, cardinal numbers, ordinal numbers).  Indeed, at some point around 1905 is became apparent that the Lebesgue integral was the "correct" setting for "general" Fourier analysis.
But once that project was completed, set theory still continued to develop (hierarchies, trees; the branch known as descriptive set theory; comparing properties of values in hierarchies, or even hierarchies themselves).  This is sort of where set theory stands today.
