But this was for functions ℝ → ℝ only.
Soon people started to consider continuous functions "of two variables", that is, functions ℝ × ℝ → ℝ, and then of n variable, so ℝⁿ → ℝ, and in each case a different definition was needed.
Moreover, because people were trying to e.g. solve differential equations, which amounts to given one *input* function (called the initial condition) to figure out an *output* function (the solution), people came across functions mapping continuous functions to continuous functions, which, themselves, may or may not be continuous.
So a general definition of continuity was needed to clean up the mess and be able to make progress more efficiently.
A first, rather useful, general setting was that of a metric space. You say what the distance between two things (e.g. real numbers, tuples of real numbers, continuous functions) is. The axioms for metric spaces are very intuitive, and I won't reproduce their statement here.
But I want to say this.
1. The definition of continuity is the same as above, with the absolute value of the difference replaced by the distance function d. A function f : X → Y is continuous iff
∀ x ∈ X , ∀ ε > o, ∃ δ > 0 , ∀ x' ∈ X, d(x,x') < δ → d(f(x),f(x')) < ε.
2. We can then define a set U to be open if for every x ∈ U there is ε > 0 such that every x' with d(x,x') < ε is in U.
3. The open sets are closed under finite intersections and arbitrary unions.
4. A function is continuous in the above ε-δ sense iff inverse images of open sets are open.
4/