Are there functions that satisfy $f(km)\bmod m=f(m)$ that are not of the form $m\mapsto n\bmod m$? For any integer $n$, consider its sequence of residues, $n\bmod1, n\bmod2, n\bmod3, \ldots$, as a function $f:\mathbb N^+\to\mathbb N$. Such a function has the following properties:
$$\begin{gather}
0\le f(m)<m, \tag{1} \\
f(km)\bmod m=f(m). \tag{2}
\end{gather}$$
Does there exist a function that has properties $(1,2)$ but is not identical to $m\mapsto n\bmod m$ for any fixed $n$? If so, are there uncountably many such functions?
(This may be an obvious "number theory 101" problem, but I know zero number theory. It came up when I was trying to answer whether there are functions that satisfy the tangent addition rule $f(a+b)=\frac{f(a)+f(b)}{1-f(a)f(b)}$ that are not linear transformations of the tangent function.)
 A: It is easy to construct a counterexample by induction and a diagonal
argument (in fact,
a little more work shows that there are uncountably many counterexamples). 
In the sequel,  $f$ is always a map $A\to {\mathbb N}$
(where $A$ is a subset of ${\mathbb N}^{+}$). I say that $f$ is Rahul iff it satisfies 
$0\leq f(m) < m$ and 
$f(km) \equiv f(m) \ ({\sf mod}\ m)$ whenever $m\in A$ and $km\in A$.
Trivially, we have :
Remark 1. A map $f:{\mathbb N}^{+} \to {\mathbb N}$ is Rahul
iff the restriction $f_n$ of $f$ to $\lbrace 1,2,\ldots, n\rbrace$
is Rahul for every $n\geq 1$.
This will allow us to construct Rahul maps step by step. Indeed, by 
the Chinese remainder theorem we have
Remark 2.1. Let $f: \lbrace 1,2,\ldots, n\rbrace \to {\mathbb N}$
be a Rahul map. Then $f$ admits at least one Rahul extension 
$g:\lbrace 1,2,\ldots, n+1\rbrace \to {\mathbb N}$. 
And trivially, we have
Remark 2.2. If $n+1$ is prime,
any extension of $f$ to $\lbrace 1,2,\ldots, n+1\rbrace$ such that
$f(n+1)\in \lbrace 0,1,2,\ldots, n\rbrace$ is still Rahul (so that
$f$ has $n+1$ Rahul extensions to $\lbrace 1,2,\ldots, n+1\rbrace$).
Let $(a_k)_{k\geq 1}$ be any enumeration of $\mathbb Z$ (for example,
$a_n=-\frac{k}{2}$ when $n$ is even and $a_k=\frac{k-1}{2}$). Denote by
$(p_k)_{k\geq 1}$ the sequence of primes, so that $p_1=2,p_2=3\ldots$.
Iterating remark 2, we can construct a Rahul map on ${\mathbb N}^{+}$
such that $f(p_k) \neq (a_k \ {\sf mod}\ p_k)$ for every $k\geq 1$ : 
when extending from $\lbrace 1,2,\ldots, n\rbrace$ to 
$\lbrace 1,2,\ldots, n+1\rbrace$, if $n+1$ is not prime we extend
by Remark 2.1, and if $n+1$ is prime, $n+1=p_k$, we use Remark 2.2
and set for $f(n+1)$ any value $v$ such that $v \neq (a_k \ {\sf mod}\ p_k)$
(there are $n$ such values by Remark 2.2.).
Then by construction $f$ is distinct from the map 
$m \mapsto (a_k \ {\sf mod}\ m)$ for every $k\geq 1$, so $f$ is a counterexample. 
