Find the number of the continuous function between this topological spaces Let the $(X,T) = \{ \{1\}, \{1,2\}, \{1,3,4\} ,\{1,2,3,4\}, \{1,2,5\}, X, \phi       \}$ on $X = \{1,2,3,4,5\}$
Find the number of the continuous function $f: (X, T) \to (X,T)$ satisfying the $f(2)=2, f(3) =3$
Since the $f(\bar A) \subset \bar f(A)$ for the continuous function $f$, $f(5) \in \{2,5\}$ and $f(4) \in \{3,4\}$ considering the $A =$ $\{2,5\}$ or $\{3,4\}$ each cases. Plus $1$ is the isolated point, $f$ is always continuous at $1$. Therefore $f(1) \in \{1,2,3,4,5\}$. So my answer is $2\times 2\times 5 =20$. But the answer was $4$. It said $f$ is continuous only for the $f(1)=1$. Why the answer is $4$? How can I derive it? Plus, What the point did I have a mistake?
 A: It's IMO handiest to use the inverse image of open is open definition for continuity first:
If $1 \in f[X]$, we know that $f^{-1}[\{1\}]$ must be open and cannot contain $2$ or $3$, and so then $f^{-1}[\{1\}] = \{1\}$ and $f(1)=1$. This is case one.
If $1 \notin f[X]$, of course $f^{-1}[\{1\}]=\emptyset$ which is open, as it must be. This is case two.
Going on in in case one, we know then that $f(x)=x$ for $x=1,2,3$. What more can we say? $f^{-1}[\{1,3,4\}]$ must be open as well and contains $\{1,3\}$ as a subset already. We can only add one point to it by mapping to $4$ and the only open subset that has two or three elements and has $\{1,3\}$ as a subset is $\{1,3,4\}$ again. It follows that $f(4)=4$ as well. Now $f^{-1}[\{1,2,5\}]$ has two or three elements and $\{1,2\}$ as a subset. So either it's $\{1,2\}$ and $5 \notin f[X]$, or it's $\{1,2,5\}$ and $f(5)=5$ and $f=1_X$ (which always is continuous).
So what in case 1 if $5 \notin f[X]$? Where can $5$ map to? If to $1$ it would make $f^{-1}[\{1\}=\{1,5\}$ which is not open, so that cannot be. $2$ is similarly refuted by $f^{-1}[\{1,2\}]=\{1,2,5\}$, $3$ by $f^{-1}[\{1,3,4\}]=\{1,3,4,5\}$, while mapping to $4$ gives $f^{-1}[\{1,3,4\}=\{1,3,4,5\}$, also not open. So this subcase is in fact a dead end.
Conclusion: case 1 leads to a unique function $1_X$, always continuous anyway.
Now to case 2: $1 \notin f[X]$, initially overseen by markvs' answer.
We know that $2 \in f^{-1}[\{1,2\}] = f^{-1}[\{2\}]$ and also $1 \notin f^{-1}[\{1,2\}]$. There is no open set that contains $2$ but not $1$ so this case also immediately terminates.
A unique but boring function it is.
You see that this is quite tedious, I seem to recall from a paper on finite spaces that there is a more efficient algorithm to do this kind of problems by looking at the specialisation order or minimal neighbourhoods.
A: The correct answer is $1$. Only the identity function satisfies all conditions.
It is better to look at preimages of open sets. The preimage of every open set must be open.
The preimage of
$\{1\}$ must be open, but it does not contain $2$ or $3$. So only  $1$ can go to $1$.
The preimage of $\{1,2\}$ must be open, it contains both $1$ and $2$ but cannot contain $3$.  So it may be either $\{1,2\}$ or $\{1,2,5\}$. Thus the preimage of $2$ is either $\{2\}$ or $\{2,5\}$ - two cases.
Case 1. Suppose that the preimage of $2$ is $\{2\}$. The preimage of $\{1,2,5\}$ must contain $1,2$, cannot contain $3$. So it is $\{1,2,5\}$. Thus the preimage of $5$ is $\{5\}$. Then the preimage of $\{1,3,4\}$ must contain $1,3$ but cannot contain $2, 5$. So the preimage of $\{1,3,4\}$ is $\{1,3,4\}$ and $f(4)=4$. Thus in this case $f$ is the identity function.
Case 2. Suppose that the preimage of $2$ is $\{2,5\}$. So $f(5)=2$.
The preimage of $\{1,2,5\}$ must contain $1,2$, cannot contain $3$. That preimage cannot be $\{1,2,5\}$ because $f(5)=2$. There are no other options, so this case is impossible.
Edit: As @HennoBrandsma noticed I have not considered the case when the preimage of $1$ is empty. In that case the preimage of $\{1,2\}$ must contain $2$ but cannot contain $3$, so it is  $\{1,2,5\}$. But then  $f(5)=1$ which is impossible because the preimage of $1$ is empty.
