Sets unchanged by a certain function form a topology? Reviewing a bit of topology, and I'm trying to recall all the different ways to define a topology.
Suppose I have some function $f$ on $\mathcal{P}(X)$ for some set $X$, that has the following properties. For any $S,T\subseteq X$,


*

*$\varnothing=f(\varnothing)$

*$S\subseteq f(S)$ 

*$f(f(S))=f(S)$

*$f(S\cup T)=f(S)\cup f(T)$


I want to show that the sets $\mathcal{T}=\{A\mid f(A^c)=A^c\}$ form a topology from the open set point of view. I see that $\varnothing, X\in\mathcal{T}$, as well as finite intersections of sets in $\mathcal{T}$. 
How can I show that $\mathcal{T}$ is closed under arbitrary unions? Taking $\mathcal{A}\subseteq\mathcal{T}$, then $f((\cup\mathcal{A})^c)=f(\cap
_{A\in\mathcal{A}} A^c)$, and I want this to equal $\cap_{A\in\mathcal{A}} A^c$.
I suspect this uses the property that $f$ is idempotent, since I didn't use that to show the other three properties. This looks a lot like a map mapping sets to their closure, defined as the complement of open sets to me, but I can't complete it. 
 A: First let us note that $A\subseteq B\subseteq X$ implies $f(A)\subseteq f(B)$. Indeed, if $A\subseteq B$, then $f(A)\subseteq f(A)\cup f(B)=f(A\cup B)=f(B)$.
Now let us take $\mathcal{A}\subseteq\mathcal{T}$ and denote $C=\bigcap_{A\in\mathcal{A}}A^c$. We want to show that $f(C)=C$. By the second property $C\subseteq f(C)$, so it suffices to show that $f(C)\subseteq C$. Since $C\subseteq A^c$ for all $A\in\mathcal{A}$, by above observation $f(C)\subseteq f(A^c)$ for all $A\in\mathcal{A}$. But $f(A^c)=A^c$ holds for all $A\in\mathcal{A}$ by definition of $\mathcal{T}$. Hence $f(C)\subseteq A^c$ for all $A\in\mathcal{A}$, in other words $f(C)\subseteq \bigcap_{A\in\mathcal{A}}A^c=C$.
By the way, the four properties of $f$ are called the Kuratowski closure axioms.
Addendum: As Willie Wong pointed out the third property (the idempotency of $f$) is not needed to prove that $\mathcal{T}$ is a topology. In other words, if we have a function $f:\mathcal{P}(X)\to\mathcal{P}(X)$, which satisfies all the other properties but not necessarily the idempotency, then this same definition $\mathcal{T}=\{A:f(A^c)=A^c\}$ gives us a topology just as well. However, the role of the idempotency property is to guarantee that $f$ is the closure operator $\operatorname{cl}$ with respect to the topology $\mathcal{T}$.
Let's examine more closely how the idempotency property affects the relationship between the sets $f(A)$ and $\operatorname{cl}(A)$ where $A\subseteq X$. Note that the family of closed sets wrt. $\mathcal{T}$ is the set of fixed points of $f$, and by definition $\operatorname{cl}(A)$ is the intersection of all the closed sets containing $A$, so
$$\operatorname{cl}(A)=\bigcap\{C\subseteq X:A\subseteq C,C\text{ is closed}\}=\bigcap\{C\subseteq X:A\subseteq C=f(C)\}$$
If $C\subseteq X$ is such that $A\subseteq C=f(C)$, then by our first observation ($A\subseteq B\Rightarrow f(A)\subseteq f(B)$) $f(A)\subseteq f(C)=C$. This means that $f(A)\subseteq \operatorname{cl}(A)$, and even without the idempotency property. However, for the converse inclusion $\operatorname{cl}(A)\subseteq f(A)$ the idempotency of $f$ is necessary, because $\operatorname{cl}$ is idempotent, so let's assume $f$ is idempotent. Then $A\subseteq f(A)=f(f(A))$ which means $\operatorname{cl}(A)\subseteq f(A)$, so $f(A)=\operatorname{cl}(A)$.
To conclude, if $f:\mathcal{P}(X)\to\mathcal{P}(X)$ has the properties $f(\emptyset)=\emptyset$, $S\subseteq f(S)$ and $f(S\cup T)=f(S)\cup f(T)$ for all $S,T\subseteq X$, then $\mathcal{T}=\{A:f(A^c)=A^c\}$ is a topology of $X$ and $f(S)\subseteq\operatorname{cl}(S)$ for all $S\subseteq X$. Furthermore $\operatorname{cl}(S)\subseteq f(S)$ for all $S\subseteq X$ (and thus $f=\operatorname{cl}$) if and only if $f(f(S))=f(S)$ for all $S\subseteq X$.
Finally a concrete example to show that $f$ and $\operatorname{cl}$ may differ. Take $X=\mathbb{Z}$ and define
$$f:\mathcal{P}(\mathbb{Z})\to\mathcal{P}(\mathbb{Z}),\ f(S)=S\cup\{s+1:s\in S\}=S\cup(S+1).$$
It is not hard to see that $f$ satisfies the properties except for the idempotency. Indeed $$f(f(\{0\}))=f(\{0,1\})=\{0,1,2\}\neq\{0,1\}.$$
As we noted earlier, the family $\mathcal{T}=\{A:f(A^c)=A^c\}$ is a topology even though $f$ is not idempotent, and the closed sets are the fixed points of $f$, which are clearly $\emptyset$ and $\mathbb{Z}$, as $f$ adds points to all the subsets except for these two. This means that $\mathcal{T}$ is the indiscrete topology and thus the closure of any nonempty subset is $\mathbb{Z}$. Clearly this closure operator is very different from $f$.
