Is the set of fixed points in a non-Hausdorff space always closed?

It is not hard to show that if $f: X \rightarrow X$ is a continuous map and $X$ is a Hausdorff space, then the set of fixed points is closed in $X$. We basically just look at the diagonal and consider the map $g: X \rightarrow X \times X$ defined by $g(x)=(x,f(x))$.

What happens if we drop the condition that $X$ is Hausdorff? I guess the set of fixed points is not closed anymore. What would be an example? I tried looking at the cofinite topology but didn't find an example.

-
The cofinite topology on any infinite set $X$ should indeed provide a ($T_1$) example, as you mention in the question. Any finite-to-one function from $X$ to $X$ is continuous w.r.t. this topology, and you can realize any subset of $X$ as the set of fixed points of such a function (in fact you can get away with a permutation for almost any subset). –  user83827 Aug 5 '11 at 18:13

Here is a nice example. Let $X$ be a set with $|X|>2$, and give $X$ the trivial topology (so the only open sets are $\varnothing$ and $X$). Let $a,b\in X$ be distinct points. Then the map $f:X\to X$ with $f(a)=b$, $f(b)=a$, and $f(x)=x$ for any $x\neq a,b$ has as its set of fixed points $X\setminus\{a,b\}$, which is not closed because the only closed sets are $\varnothing$ and $X$.
It is easy to see that $X$ is not Hausdorff; because the only open sets available to us are $\varnothing$ and $X$, we can't separate distinct points with disjoint open sets.
Very nice. You can reduce to $X=\{0,1\}$ with trivial topology and a constant function $f(x)=0$ as well. –  Asaf Karagila Aug 5 '11 at 18:05
Ah, good point, that's a tad simpler than my example. Also, I wonder if $X$ is Hausdorff $\iff$ $\text{Fix}(f)\subseteq X$ is closed for every continuous $f:X\to X$; it seems plausible. –  Zev Chonoles Aug 5 '11 at 18:11
@Zev: I would be very surprised if this were true, but it doesn't seem easy to construct a counterexample. Any counterexample needs to be infinite and $T_1$, but not Hausdorff, and I don't have good constructions for such spaces which don't result in a huge collection of endomorphisms... –  Qiaochu Yuan Aug 5 '11 at 18:49
@Qiaochu: Note that Zev's "conjecture" (if to use this word, after that other thread) implies $T_1$, as any constant function will only have one fixed point, so in particular all points are closed. –  Asaf Karagila Aug 5 '11 at 19:15