TITLE: How to find all morphisms from $(\mathbb{N}, \mid)$ to $(\mathbb{N}, \mid)$?
QUESTION [7 upvotes]: I just need a small hint, not the full answer. I know that, if $f$ is a morphism,

$a \mid b \implies f(a) \mid f(b)$
$a \mid b$ and $a \mid c \implies a \mid b+c$, so $f(a) \mid f(b),   f(a) \mid f(c), f(a) \mid f(b + c)$. Also, $f(a) \mid f(b) + f(c)$
$\forall a \in \mathbb{N}, a \mid 0$, so $\forall a \in \mathbb{N}, f(a) \mid f(0)$
$\forall a \in \mathbb{N}, 1 \mid a$, so  $\forall a \in \mathbb{N}, f(1) \mid f(a) $

From these I can draw some conclusions:
a. From 3., $f(0) = a$ ($a \neq 0$), $f(\mathbb{N})$ only contains divisors of $a$.
b. From 4., if $f(1) = a$, then $f(\mathbb{N})$ only contains multiples of $a$.
The most general form I can think of for f is this:
$f(x) = ax^{b} (a, b \in \mathbb{N})$, but I can't seem to go any further than this.
Any help is appreciated.

REPLY [3 votes]: It's a big hairy beast.  
At all times, we will assume the prime factorization of $n$ is $n=p_1^{a_1}...p_k^{a_k}$.
For example, define a function first for each prime power, and then you can define $\phi(n)=\phi(p_1^{a_1})...\phi(p_k^{a_k})$. That only gives some basic examples, hardly begins to scratch the surface, but the restriction of $\phi$ at any prime power can be almost anything.  (You can't define it arbitrarily for prime powers - for each $p^a$ you can choose $\phi(p^a)/\phi(p^{a-1})$ arbitrarily.)
One non-trivial example is to define $\phi(n) = p_1p_2...$. In this case your result is always square-free. Indeed, the function returns the largest square-free divisor of $n$.
Another non-trivial example would "forget" the power of $2$ is the prime factorization: $\phi(n)$ is the largest odd factor of $n$.
These first two examples preserve $\gcd$ and $\operatorname{lcm}$, which are the meet and join operator of $(\mathbb N,\mid)$.
Another example would be $\phi(n)=x^{\max(a_1,...a_k)}$, for some fixed $x\in\mathbb N$. This does not preserve $\gcd$, I don't think.
It might be worth just looking at examples that only depend on two primes. So morphisms $\phi$ such that $\phi(2^{a_1}3^{a_2}p_3^{a_3}...p_k^{a_k})=\phi(2^{a_1}3^{a_2})$ for all values. Even that is going to be an interesting mess.