this was a true and false question which I mistakenly thought was false.
My reasoning was thus:
Let the function $f: \mathbb{R} \rightarrow \mathbb{Z}$ be injective. It follows that for every element $x \in \mathbb{R}$, there exists a unique $y \in \mathbb{Z}$ such that $f(x)=y$. But this would imply that $|\mathbb{R}| \leq |\mathbb{Z}|$, which is contradiction since $|\mathbb{R}|$ is uncountable and $|\mathbb{Z}|$. Therefore there is no function $f: \mathbb{R} \rightarrow \mathbb{Z}$ such that $f$ is injective.
Could someone tell me where I went wrong?