Proof help for the existence of a function in Velleman 3rd Chapter 8 section 2 I'm quite stuck on problem 16 from above chapter in Velleman's book.
Prove there is a function $f: \Bbb Z^+ \rightarrow \Bbb Z^+$ such that for all positive integers $a$, $b$, and $c$ there exists a positive integer $n$ such that $f(an+b) = c$.
To prove this I need to come up with said function $f$. I know that for specific $a$ and $b$, $an+b$ describes a kind of discrete linear function on the positive integers, the range of which is infinite. Also, every infinite subset $A$ of $\Bbb Z^+$ is denumerable, so $A \sim \Bbb Z^+$. But this is where I fail to come up with a function $f$ general enough to work for every possible $a$ and $b$. When definining $f$, I don't know anything about $a$, $b$, or $c$. After coming up with $f$ the only "value" I can tweak is $n$.
To proceed I would greatly appreciate some hints.
 A: Define $f$ recursively as follows. First set $f(1)=1$ and set $N_1 = 1$, $N_0 = 0$. Now, suppose that for some $n\geq 1$, $f(l)$ has been defined for all $l\leq N_n$. Let $N_{n+1} = N_{n+1} + (N_{n+1}-N_n) + n\cdot 1 + (n+1)$. Then, for $N_n < l \leq N_{n+1}$ we define $f(N_n +(n+1)\cdot l+x) = l+1$ for $0\leq l\leq n$ and $0\leq x \leq n$. This function will be the sought function.
Note that the idea above is that at the $n:th$ step, we define $f$ as either $1,...,n+1$ on streaks of consecutive integers of length $n+1$. This ensures that no matter what the value of $a$ is, we will eventually have $a < n + 1$ such that $f(an+b)$ will in fact equal every $c$ infinitely many times.
A: Think of listing the possible triples $(a, b, c)$ in order (it's a countable set). Now sequentially choose an $n(a, b, c)$ for each and define $f(a \cdot n(a, b, c)+b) = c$. You need to make sure that you aren't defining the function twice for any argument, which you can do by making each successive $n(a, b, c)$ large enough. Is that enough of a hint?
