Why don't clopen sets pose problems in the "preimage" definition of continuity, and in the definition of a topology? Recently I have been wrestling with the reasoning behind why clopen sets do not lead to contradictions when we define continuity in terms of open/closed sets, the topology of metric spaces, and other concepts, and I would appreciate some clarification as to what the reasoning is in the situations I have described below.

Definition 1: A function $f:M\to N$ (for $M,N$ metric spaces) is continuous if the preimage of each closed set in $N$ is closed in $M$.
For the following theorem we let $\mathcal{T}$ be the collection of all open sets of $M$.
Theorem: The topology $\mathcal{T}$ of a metric space $M$ has 3 properties: as a system it is closed under union, finite intersection, and it contains $M$ and $\emptyset$. That is

*

*Every union of open sets is an open set


*The intersection of finitely many open sets is an open set


*$\emptyset$ and $M$ are open sets

For definition 1 we consider the constant function $f:\mathbb{R} \to \{c\}$ for some constant $c\in \mathbb{R}$. This obviously satisfies the $\epsilon{-}\delta$ condition and is continuous. But $\mathbb{R}$ is a clopen set, and we have that the preimage of $\{c\}$ is both open and closed, and the image is closed, so why do we ignore the fact that the preimage is also technically open when considering continuity for this function?
Similarly if $M$ in the context of part (3) of the theorem is both open and closed, why do we only consider the fact that it is open when determining whether it belongs to $\mathcal{T}$? I understand that being open is the only criteria for belonging to $\mathcal{T}$, but if being clopen doesn't exclude a set from being in the topology, why do we only specify that the sets are open when determining a criteria for belonging?
 A: 
For definition 1 we consider the constant function $f:\mathbb{R} \to \{c\}$ for some constant $c\in \mathbb{R}$. This obviously satisfies the $\epsilon -\delta$ condition and is continuous, but $\mathbb{R}$ is a clopen set, and we have that the preimage of $\{c\}$ is both open and closed, and the image is closed, so why do we ignore the fact that the preimage is also technically open when considering continuity for this function?

Why would we not ignore it? Your definition of continuity requires that the preimage of a closed set be closed, but it doesn't specify that it must also not be open.

Similarly if $M$ in the context of the theorem (part (c)) is both open and closed, why do we only consider the fact that it is open when determining whether it belongs to $\mathcal{T}$? I understand that being open is the only criteria for belonging to $\mathcal{T}$, but if being clopen doesn't exclude a set from being in the topology, why do we only specify that the sets are open when determining a criteria for belonging? 

Knowing which sets are open amounts to exactly the same thing as knowing which sets are closed, for $A \subseteq M$ is open iff $A^c \subseteq M$ is closed.
A: Closed is not the same as "not open". There is no contradiction.
