The exercise was to determine if the function $f : \mathbb{Z} \rightarrow \mathbb{Z}_{1729}, f(n) = n + 6 \mod{1729}$ is injective or not.
My thinking was that $f(-7) = 1728\\ f(-6) = 0\\ f(-5) = 1\\ \vdots\\ f(0) = 6\\ f(1) = 7\\ \vdots\\ f(1722)=1728\\ f(1723) = 0$
and so on, we will get all numbers in $\mathbb{Z}_{1729}$.
However, this turned out to be wrong, but the solution doesn't say why, though. Why is this function not injective?
You seem to be thinking surjective, meaning that the image of $\mathbb{Z}$ under $f$ is all of $\mathbb{Z}_{1729}$. Injective means there would not be two different integers, say $n,m$ such that $f(n)=f(m)$. Equivalently, if $f(n)=f(m)$ then we must have $n=m$.
This cannot be the case for $f$ since it repeats at least every 1729 integers. For example, $$ f(0)=0+6 \equiv 0 \mod 1729 $$ $$ f(0+1729)=f(1729)=1729 \equiv 0 \mod 1729 $$ In fact, this will work for any integer $n$: $f(n+1729)=f(n)$. So $f$ cannot be injective.