Characterizing continuous maps in $\Bbb N$ with co-finite topology I wanted to find a characterization of continuous maps $f : \Bbb N \to \Bbb N$, both co-finite topology.
The identity map and constant maps work. Polynomials (not all, positive ones on $\Bbb R^+$ that sends integers to integers) seem to work too since if $S$ is a finite set, hence closed, $S:=\{n_1,\cdots,n_k\}$, then $f^{-1}(S)=\bigcup_{i=1}^k f^{-1}(n_i)$ is a finite set, $\emptyset$ or $\Bbb N$ : a closed set.
I feel that we can get such maps can by taking continuous real maps $f:\Bbb R \to \Bbb R$ such that $f(n) = k$ with $n,k \in \Bbb N$ and maybe such that $\lim_{x \to \infty} f(x) = + \infty$ ? I am saying that because if we consider $f(n)=\cos(n \pi)$, then $f(n)$ is an integer but $f^{-1}(1)=2 \Bbb N$ so $f$ is not continuous (pre-image of a closed set is not closed).
So my guess would be
$$f \text{ continuous in } \Bbb N \text{ with co-finite topology} \iff f \text{ real function that sends integers to integers and} \lim_{x \to \infty} f(x) = + \infty$$
I think I got the implication $\Longleftarrow$ : let $S$ be a closed set, i.e. a finite set $S:=\{n_1,\cdots,n_k\}$. We consider $f^{-1}(S)=\bigcup_{i=1}^k f^{-1}(n_i)$. Since $\lim_{x \to \infty} f(x) = + \infty$, then $\exists a > 0$ such that $f(x) > \max(n_i) \forall x > a$. Then $f^{-1}(n_i) = \Bbb N \cap (- \infty,a)$ (I am not $100%$ sure here). So $f^{-1}(n_i)$ is finite and  $\bigcup_{i=1}^k f^{-1}(n_i)$ too. Hence $f$ is continuous.
I struggle a bit for the other way, is it even true ?
EDIT : I think I got the other implication too : by contrapositive, if $\lim_{x \to \infty} f(x) \neq + \infty$, then exists a convergent sequence $f(x_n) \to l$, it implies that there exists $N>0$ such that $\lvert f(x_n)-l \rvert \leq 0.5 $ so that $f(n)=K \forall n > N$ with $K \in \Bbb N$, it implies that $f^{-1}(K)$ is infinite so not closed $\implies f$ not continuous.
 A: Theorem: Let $f$ be a function from $\Bbb N$ into $\Bbb N$ and consider on $\Bbb N$ the co-finite topology. Then these conditions are equivalent:

*

*$f$ is continuous;

*$f=F|_{\Bbb N}$ for some function $F\colon[1,\infty)\longrightarrow\Bbb R$ such that $\lim_{x\to\infty}F(x)=\infty$.

Proof: Suppose that the second condition holds. Then, if $n\in\Bbb N$, there are only finitely many natural numbers $k$ such that $f(k)=n$. That's so because there is some $M>0$ such that $x>M\implies F(x)>n$, and there are only finitely many natural numbers in smaller than or equal to $M$. So, if $\mathcal F$ is a finite subset of $\Bbb N$, with $\mathcal F=\{n_1,n_2,\ldots,n_k\}$, $f^{-1}(\mathcal F)=\bigcup_{j=1}^kf^{-1}(\{n_j\})$, which is finite. SO, $f$ is continuous.
Now, suppose that the first condition holds. Define $F\colon[1,\infty)\longrightarrow\Bbb R$ by $F(x)=f\bigl(\lfloor x\rfloor)$. Clearly, $F|_{\Bbb N}=f$. I will prove now that $\lim_{x\to\infty}F(x)=\infty$. Take $M>0$. If $\mathcal F=\Bbb N\cap[1,M)$, then $\mathcal F$ is finite, and therefore $f^{-1}(\mathcal F)$ is finite too. Take $M'$ greater than any element of $f^{-1}(\mathcal F)$. Then $x>M'\implies F(x)>M$.
A: It's clear that $f:\Bbb N \to \Bbb N$ is continuous (where the codomain has the cofinite topology) iff $f^{-1}[\{n\}]$ is closed in the domain for all $n$.
S if the domain also has the cofinite topology:
$f:\Bbb N \to \Bbb N$ is continuous iff for all $n$: $f^{-1}[\{n\}]$ is either finite or $\Bbb N$ (the latter covers the case of constant maps).
So for non-constant maps it's just those maps that are not too badly non-injective. No condition with limit is needed.
Polynomials obey this of course.
