Show that the function $f:\mathbb Z^+ \to \mathbb Z^+ $ is continuous if and only if $m\mid n$ implies that $f(m)\mid f(n)$. Let $(\mathbb Z^+,\tau )$ be a topological space with $\tau$ being the collection of every $U\subset \mathbb Z^+$ such that if $n\in U$ and $m\mid n$ then $m\in U$.
Show that the function $f:\mathbb Z^+ \to \mathbb Z^+ $ is continuous if and only if $m\mid n$ imply that $f(m)\mid f(n)$.
I know that for $f$ to be continuous we need that for every $V\in \tau$ then $f^{\leftarrow}[V]\in\tau$ but I can't see how does this imply that if $m\mid n$ then $f(m)\mid f(n)$.
I even thought that the problem was wrong and maybe it needed to say that $f(m)\mid f(n)$ imply that $m\mid n$ but even like this I don't see how this is true, for example lets say that $V=\{f(1)=1,f(4)=3,f(2)=5=f(3)\}\in \tau$ then $f^{\leftarrow}[V]=\{1,2,3,4\}\in\tau$, this could be a continuous function but  $2\mid 4$ doesn't imply that $f(2)\mid f(4)$
I would appreciate any help, thanks.
 A: Suppose that $f$ is continuous and $m \mid n$. Let $V$ be the set of all divisors of $f(n)$ (which is clearly open). Then, by continuity, $f^{\leftarrow}[V]$ must also be open. Since $n \in f^{\leftarrow}[V]$ and $m \mid n$, one also has that $m \in f^{\leftarrow}[V]$, which means that $f(m) \mid f(n)$.
Conversely, suppose that $m \mid n$ implies $f(m) \mid f(n)$ and $V$ is open. Then, to show that $f^{\leftarrow}[V]$ is also open, one needs to show that if $n \in f^{\leftarrow}[V]$ and $m \mid n$, then also $m \in f^{\leftarrow}[V]$. By assumption, $f(m) \mid f(n)$. Also, $f(n) \in V$, and so $f(m) \in V$ since $V$ is open. This means that $m \in f^{\leftarrow}[V]$. Thus, $f^{\leftarrow}[V]$ is open. Thus, $f$ is continuous.
A: $f$ continuous means preimages of open sets are open. A set is open in your topology for any $n$ in the set all divisors of $n$ are also in the set.
Now, take an open set $U$. Then $O=f^{-1}(O)$ is open. Now consider $U$ the set of all divisors of $f(x)$. Then $O$ is open. In particular any divisor of x is in $O$, so for any such $y$ we must have $f(y)\in U$, so $f(y)|f(x)$.
Conversely if $y|x\Rightarrow f(y)|f(x)$. Take an open set $U$ and it’s preimage $O$. Then if $x\in O$ then we have for all $y|x$ that $f(y)|f(x)$. Thus $f(y)\in U$, so $y\in O$. Thus $O$ is open and thus $f$ continuous.
A: Suppose first that $f$ is continuous, so given some $f(x)$ and a neighbourhood $V$ around $f(x)$, there exists some neighbourhood $U$ around $x$ such that $f(x) \in f(U) \subset V$. Picking some $y$ such that $y | x$, we note that $y \in U$, so $f(y) \in V$ and, by definition, $f(y) | f(x)$.
Conversely, suppose that $m | n \Rightarrow f(m) | f(n)$. Pick some point $f(x)$ and a neighbourhood $V$ around $f(x)$. Let $U$ be the open set defined by taking all $y$ such that $y | x$. By assumption, we have $f(y) | f(x)$ for all $y \in U$, so $f(U) \subset V$. Thus, $f$ is continuous.
A: $(\Leftarrow)$ We need to prove that given $V\in\tau$ such that $\forall k\in V$, $\exists n\in\mathbb Z^+$ with $f(n)=k,$ then $f^{\leftarrow}[V]:=U\in\tau$.
Let $f(n)\in V$, then $n\in U$; with our assumption we have that if $m\mid n$ then $f(m)\mid f(n)$, thus $f(m)\in V$ because $V$ is open, so we can conclude that $m\in U$ and that $U\in\tau$.
$(\Rightarrow)$ Now we need to prove that $m\mid n \Rightarrow f(m)\mid f(n)$
WLOG. Let $V=\{k\in\mathbb Z^+:k\mid f(n)\}$ then $f(n)\in V$ and $n\in f^{\leftarrow}[V]:=U$, thus if $m\mid n$ we must have that $m\in U$, because $f$ is continuous, therefore $f(m)\in V$ and the implication is proven.
