What is a good text which introduces ODE in a very general setting? For your information, I have studied almost all undergraduate mathematics except for differential equation and I'm really comfortable with what I have learned.
Moreover, I have taken an one semester ODE course before even though I forgot them all.
When one first learns analysis, one is usually taught in a very limited setting such as $\mathbb{R}$ and $\mathbb{C}$. For example, most freshmen learn "intermediate value theorem" in $\mathbb{R}$, but it is generally a topological property, so that one can prove this fact in much more general setting.
I rememebr that, the same thing happens in ODE course, that is, every function we consider is a function on $[a,b]$. Well, if this is the best setting for the theory, then I would be fine, but is there a general setting for ODE?
For example, one can learn measure theory on $\mathbb{R}^n$, but the most general setting for measure theory is usually a locally compact Hausdorff space.
What is the most general setting for ODE and what is a text introducing this theory in this general setting?
I don't mind whether the text is tough or not if there is no preliminary requirement of differential equation.
Thank you in advance :)
 A: It is always a pleasure to discuss books which have contributed to my growth and understanding, so if I wax on at length in the following, please bear with me.
First of all, before going any further, let me answer Rubertos' main question by putting forth a reccomendation for a text on ordinary differential equations; it is a book which, though it has been around for quite awhile, provides, in my not-always-so-humble opinion, an excellent introduction to the classical theory of ODEs, building from the ground up as it were, not requiring experience with ODEs (theoretically), but instead taking the reader from first principles on normed spaces through contraction mappings then on into existence and uniqueness theorems followed by a host of applications to both linear and non-linear systems, providing a great many excellent examples as it does so.  The book is:
Ordinary Differential Equations, by Jack K. Hale,
and to help it be found by those desirous of so doing, here is the Library of Congress Cataloging-in-Publication Data from the front of my copy:
Hale, Jack K.
Ordinary differential equations / Jack K. Hale. -- Dover ed.
Originally published:  New York:  Wiley, 1969.
Includes bibliographical references.
ISBN-13:  978-0-486-47211-9
ISBN-10:  0-486-47211-6


*

*Differential equations. I. Title.


QA372.H184 2009
515'.352--dc22
The book has been picked up and re-issued by Dover Publications and is available via the usual sources--Amazon, etc., for about US $20.00.  Well worth the investment.  Also carried by many college and university libraries.  Should be easy to find a copy.
The book is direct, thorough, and rigorous; the only apparent pre-requisites are a solid understanding of advanced calculus, elementary differential equations, and basic real and functional analysis.  Indeed, the book could be read and understood without any previous exposure to ODEs; though such an undertaking would clearly be challenging, I think it is possible in principle; my point is that the book is virtually self-contained as an introduction to ordinary differential equations.  Still, the work goes quite far in certain directions.
The first chapter presents a rapid review of the necessary real and functional analysis, including proofs of various fixed-point theorems for contraction mappings etc.  In the second chapter, such tools are used to present the essential theory of ODEs, namely, existence, uniqueness and so forth, with rigor and attention to detail.  After that, the book takes off, exploring many interesting subjects in depth:  two-dimensional systems, both planar and toral; linear systems, including an excellent treatment of Hill's equation; periodic orbits and invariant manifolds are also treated at some length.  I know of no other work on the subject which addresses such a broad selection of intrigueing and important topics with such detail and rigor.
In case you all haven't noticed, I really like Hale's book.
If I want a rigorous treatment of the essential theory, I generally turn to Hale.  But there are a few other books which are so outstanding, to my mind at least, that they are worthy of mention.
First, a more modern treatment with a strongly geometrical bent may be found in the works of Arnol'd, and here I would especially recommend his Mathematical Methods of Classical Mechanics (Springer-Verlag, 1989) and his Geometrical Methods In The Theory Of Ordinary Differential Equations, (also Springer-Verlag, 1988).  But anything by Arnol'd is worth checking out.  As I recall, these works don't emphasize hard analysis as much as they do geometrical insight; in this sense, they complement Hale very nicely.
Second, and still in keeping with the geometrical approach, is the amazing work Foundations of Mechanics by Ralph Abraham and Jerrold Marsden.  Now, it must be admitted that both this work, as well as Arnol'd's Mathematical Methods of Classical Mechanics, when judged by their titles alone, would seem to be books on physics.  However, the historical relationship between mechanics, dynamical systems and ordinary differential equations is both venerable and deep; the subjects have driven each other since before Newton's Principia.  So it should come as no surprise that an excellent treatment of certain aspects of the theory of ODEs might be found in works with the word "mechanics" in their titles.  To see the depth of the mathematics-mechanics connection, take a look at these works.  What you see will inform you better than more verbiage on the part of Yours Truly.  Incidentally, Abraham and Marsden's book is available for free, legally, from Caltech; follow this link to find it.
I should also briefly mention another little book which has helped me a lot; that is Witold Hurewicz's Lectures on Ordinary Differential Equations; I believe it was first published by the MIT Press in 1958; thus it predates even the ancient Hale by about a decade.  A short book, only 140 pages or so, it nevertheless gives a very clear and rapid introduction to the essentials; Hurewicz is an excellent expositor.  Still available from Dover, too.  It's substantially less broad in scope than Hale's book, so it may be more accessible.  
Finally, if these works are perchance a little too advanced for the reader's particular needs and/or state of mathematical development, then perhaps a look at Hirsch, Smale and Devaney's Differential Equations, Dynamical Systems, and an Introduction to Chaos ($3$rd edition, Academic Press, ISBN 10: 0123820103 / ISBN 13: 9780123820105) is merited.  This work covers much material similar to that in Hale, but form a more elementary, yet largely rigorous, point of view.  It contains proofs of the main existence and uniqueness theorems, and a self-contained introduction to the necessary linear algebra.  Plenty of good applications and examples as well.  Indeed, one might start with this work and then move quite naturally into Hale's deeper treatment.
But enough about books; let's move on to the general setting of ODEs themselves.  Intervals in the real line occur with such ubiquity by virtue of the the fact that, by definition, we are dealing with functions of one independent variable.  That's what makes an ODE an ODE, as opposed to a partial differential equation which may have any number of independent variables.  Accepting this to be the case, what else to we need?  Well, we have to be able to discuss differentiable functions; to define the derivative, we generally require that the range space in which our functions take their values be possessed of the operations of addition and scalar multiplication, the basic operations which make it possible to discuss a derivative.  Since we need to talk about continuity, convergence and limits, some sort of topology is required.  From this point of view, Banach spaces form a very general yet natural setting for the image spaces of our functions on intervals in $\Bbb R$.  So I would say that the essential elements of the theory of ordinary differential equations would almost have to include intervals in $\Bbb R$ and Banach spaces.  Of course, these things can be generalized even further: one can consider Frechet instead of Banach spaces, for example.  But as a generally agreed upon set of generalities to set up the general theory of ODEs, I think the notions focused on here would suffice.
I suppose, in light of the above, one could ask whether holomorphic differential equations in one complex variable, such as
$\dfrac{df(z)}{dz} = f(z), \tag{1}$
should be seen as specialized partial differential equations, via the Cauchy-Riemann equations, or a kind of generalized ordinary differential equation, by virtue of the fact that there is but one independent variable $z$, albeit we have $z = x + iy \in \Bbb C$, with $x, y \in \Bbb R$.  I think such equations occupy a special place in the overall scheme of classifying differential equations, since the complex numbers $\Bbb C$ are a normed field and hence submit to both the algebraic and topological operations necessary to form derivatives and integrals of functions $g:\Bbb C \to \Bbb C$; the two real independent variables $x$ and $y$ combine to form the one complex variable $z = x + iy$, and this fact contributes to the peculiar status of holomorphic odes.
Well, I've gone on quite long enough, I reckon, and it's about time I signed off of this post.  One closing remark:  Hale's book is tough, but it is thorough and very broad in outlook; I would venture to say it covers this subject in the general setting I discussed above.
Seek and ye shall find!!!
Hope this helps.  Cheers,
and as ever,
Fiat Lux!!!
