Educational setting. I'm teaching math courses - typically consisting of lectures, weekly homework sheets, and an exercise class where the homework questions are discussed - for undergraduate and Master's level students at a German university. The courses are "proof-based" in the sense that lecturers are supposed (and inclined) to prove most or all results in the course. Homework problems also regularly include proof-based questions in those courses.
Issue. Almost all lectures I've seen - and all lectures I've taught - essentially use a top-down theory building approach, where the lecturer gives some definition, proves some results, and illustrates the definitions and the results with a number of examples (either in the lectures or in the homework problems).
I'm trying to pay quite some attention to (i) the motivation of the various definitions and results and to (ii) presenting overarching schemes and narratives which show how the various topics are related and why it makes sense to study precisely those notions and results that we do study. From the course evaluations I'm under the impression that the students mostly appreciate this. However:
I still have the distinct and persistent feeling that it is very difficult for most students get of good and deep intuition of how the definitions and theorems are motiviated and how they are related. I'm also under the impression that there is too much focus on teaching students well-developed theories and too little focus on how or why such theories are developed.
Goal. One option to (partially) improve the aforementioned situation might to be to develop mathematical theories in lectures in a way which moves from questions about objects that the students already know to definitions and results that can be used to answer those questions.
I've seen a (very, very) mild version of this in the German functional analysis book "Grundkurs Funktionalanalysis" ("Introductory course on functional analysis") by Winfried Kaballo. He starts each chapter with a small set of questions which serve as a motivation for the contents of the question. I've tried to adapt this in a few lectures (with somewhat positive feedback by some students), but it is arguably only a very small step.
Question. I'm looking for course materials - in particular textbooks - which develop a mathematical topic by taking such a "motivate new contents by questions about preceding contents" approach.
Depending on the answer I would be interested in building a course based on such a book or - what is more likely - in developing my own materials for such a course and taking existing materials as an inspiration.
Scope of the question.
As mentioned at the beginning, I am mainly interested in materials for proof-based courses that develop a mathematical theory in a rigorous way. However, if you know resources for different courses (say for instance , a less rigorous Calculus course) I'd also be interested, as I hope that these material could still serve as in inspiration.
This question focusses only on course materials, not on alternative types of institutional or educational settings. I'm aware of things like the Moore method or inverted class room (and have also tried the latter myself in one course), but this is not the topic of this question.
I'm not asking for individual examples of questions that can be used to motivate certain concepts or topics. My point is rather to see an entire course that is developed in this way.
By "questions that motivate a certain concept or topic or result" I'm not mainly referring to questions that stem from applied settings. If some of the motivating questions stem from such a setting, this is fine for me - but building an entire mathematical theory will in many cases rely on many math-intrinsic questions, too. It would be great if the materials reflect this - so that they really present "how and why to build a mathematical theory from the point of view of mathematicians".
I do not think that it is necessary that the the course evolves "along historical lines". So it's ok for me if the questions that motivate the theory have occurred only in retrospective and do thus not necessarily represent the original motivations that drove the historical development of the topic.
I'm happy with course materials for any mathematical topic - although I suspect such materials will be easier to develop for some topics (for instance, linear algebra) than for others (for instance, point set topology).