Continuous function
Continuous functions between topological spaces

Another, more abstract, notion of continuity is the continuity of functions between topological spaces in which there generally is no formal notion of distance, as there is in the case of metric spaces. A topological space is a set X together with a topology on X, which is a set of subsets of X satisfying a few requirements with respect to their unions and intersections that generalize the properties of the open balls in metric spaces while still allowing one to talk about the neighborhoods of a given point. The elements of a topology are called open subsets of X (with respect to the topology).

A function f: X → Y {\displaystyle f:X\to Y} between two topological spaces X and Y is continuous if for every open set V ⊆ Y, {\displaystyle V\subseteq Y,} the inverse image f − 1 (V) = { x ∈ X | f (x) ∈ V } {\displaystyle f^{-1}(V)=\{x\in X\;|\;f(x)\in V\}} is an open subset of X. That is, f is a function between the sets X and Y (not on the elements of the topology T X {\displaystyle T_{X}}), but the continuity of f depends on the topologies used on X and Y.

This is equivalent to the condition that the preimages of the closed sets (which are the complements of the open subsets) in Y are closed in X.

An extreme example: if a set X is given the discrete topology (in which every subset is open), all functions f: X → T {\displaystyle f:X\to T} to any topological space T are continuous. On the other hand, if X is equipped with the indiscrete topology (in which the only open subsets are the empty set and X) and the space T set is at least T, then the only continuous functions are the constant functions. Conversely, any function whose codomain is indiscrete is continuous.
change_case:capital_word_frequency[7], combination:two_responses, startend:end_checker