True / False on Continuous Function In my lecture note about Compactness, there is an exercise below.

Let $(\mathbb{N}, \mathscr{T})$ be a space where $\mathscr{T}$ consists of  $\emptyset, \mathbb{N} $ and $E_n = \{1, 2, \ldots, n\}$ for each $n \in \mathbb{N}$. Prove or disprove that every continuous function $f : (\mathbb{N}, \mathscr{T}) \to \mathbb{R}$ is a constant function.

I have checked that every nonempty subset of $\mathbb{N}$ is compact. But I have no idea what to do to solve this question. Could someone give me a hint?
 A: The definition of continuity states that the preimage of every open subset of $\mathbb{R}$ must be open in $(\mathbb{N},\mathscr{T})$. In particular, $f^{-1}(\mathbb{R})$ must be open, i.e., $f^{-1}(\mathbb{R}) \in \mathscr{T}$. Can you see how to proceed?
A: Note that any two non-empty open sets in the domain intersect. Abuse Hausdorffness of $\Bbb R$ to show a continuous $f$ with at least two distinct values cannot exist. See also this answer, e.g. 
A: The main observation is that the only infinite set in $\mathscr{T}$ is $\mathbb{N}$ itself.
Assume that the image of $f$ contains at least 2 points, say $a,b\in f(\mathbb{N})$ where $a<b$.
Now since $f(\mathbb{N})$ is countable and $(a,b)$ is not, then there is $c\in(a,b)$ such that $c\not\in f(\mathbb{N})$. Therefore
$$\mathbb{N}=A\cup B$$
for $A:=f^{-1}((-\infty,c))$ and $B:=f^{-1}((c,\infty))$.
Both $A$ and $B$ are open (by continuity), nonempty, disjoint (by construction) and one of them has to be infinite (because their union is $\mathbb{N}$). WLOG assume that $A$ is infinite. Since open sets in $\mathscr{T}$ are finite except for $\mathbb{N}$ itself then $A=\mathbb{N}$. But then there is no choice for $B$ making them both nonempty and disjoint. Contradiction. $\Box$
A: Suppose $1\ne n\in \Bbb N$ with $f(n)\ne f(1).$  Let $r=|f(n)-f(1)|/2.$  Now the set $S=f^{-1}(-r+f(n),r+f(n))$ is not in $\mathscr {T},$ because $1\not \in S\ne \emptyset.$ So $f $ is not continuous.
