# What are the set-theoretic foundations of classical calculus?

I am wondering what set theoretical foundation is needed for the development of classical results of, say, calculus, such as taught in first years undergraduate courses. More concretely, I wonder if and where the full power of ZFC is needed, if that's the foundation, or what part of analysis can be developed in the theory of (well-pointed?) topoi.

For example, it is known that there are topoi for which Brouwer's theorem holds, i.e. for which any function on the reals is continuous. The problem when trying to mimick the construction of noncontinuous functions like $f: {\mathbb R}\to{\mathbb R}$, $f(x):=0$ for $x\leq 0$ and $f(x) := 1$ for $x>0$ here is that in non well-pointed topoi it's not sufficient to tell what functions do on (ordinary) points. In contrast, if I am not mistaken, if we assume to work in a well-pointed topos, Brouwer's theorem fails, and functions as the one above can be constructed (please correct me if I made a mistake here).

Which parts of calculus can and which cannot be developed within, say, ETCS? Or what about the role of the axiom of replacement (in ZFC or in addition to ETCS)?

I'd be happy to get a list of "classical" topics where one can see that the choice and strength of foundation matters.

You can witness that by the trivial observation that all the mathematics we meet on an average undergrad course happens well inside $V_{\omega+\omega}$, which is a model of $\sf Z$ (Zermelo's set theory which include separation, but not replacement). If one wishes to formalize ordinals as the von Neumann ordinals, or cardinals as initial von Neumann ordinals, then one needs to have replacement (or at least "enough" of it), but generally this is unneeded. Note that even if you want to talk about transfinite recursion up to $\omega_1$ you can still do that in $V_{\omega+\omega}$ because we do have a well-ordered set of order type $\omega_1$ in this model.