Multi-variable function bijection proof $f:\mathbb{Z}$ $\rightarrow \mathbb{Z}$ defined by $f(x)=mx^3 - nx$, where $m, n \in \mathbb{Z} $ and $m\nmid n$.
I am trying to prove whether or not the function is injective/subjective without Calculus. How can I improve this?
Injectivity:
Suppose $f(a) = f(b)$ where $a,b \in \mathbb{Z}$.
$ma^3-na = mb^3-nb \iff ma^3-mb^3 = na-nb \iff m(a^3-b^3) = n(a-b) \iff m(a-b)(a^2+ab+b^2)=n(a-b)$.
Case 1) $a-b=0$. Then $a=b$
Case 2) $a-b \not= 0$. Then $m(a^2+ab+b^2)=n \iff a^2+ab+b^2 = \frac{n}{m}$. Contradiction.
Taking case 1), therefore f is injective.
Surjectivity:
Case 1) Let $m=0$. Then $f(x)=-nx$. Suppose $f(a)=b$. Then $-na=b \iff a=-\frac{b}{n}$. For the function to be subjective, $n$ must be equal to either $1$ or $-1$. Otherwise, $a$ will not be in the codomain $\mathbb{Z}$.
Case 2) Let $m\not=0$. Then $f(x)=mx^3-nx$. If $GCD(m,n)=1$, then there exists, for every M, exactly one pair a,b such that $ax +by=M$.
 A: Your proof of injectivity is very good, well done!

Your counterexample for surjectivity, however, is nonsensical. All you did was prove that $f(2)$ is some number. You didn't prove that there exists some number $z$ for which $f(x)\neq z$ no matter what $x$ is.
In other words, to prove that $f:A\to B$ is not surjective, you must prove the following statement:
$$\exists b\in B: \forall a\in A: f(a)\neq b.$$

Guidelines regarding surjectivity:
In general, surjectivity of the function will depend on the choice of $m,n$. In particular, taking $m=0,n=1$ means the function is surjective, while taking $m=4,n=2$ means it is not (because it only has even values).
Further hints:
I would split the cases a little.

*

*If $m=0$, then it should be relatively easy to show if the function is surjective or not. In particular, it is surjective if $n=1$ or $n=-1$, otherwise, it is not.

*If $m\neq 0$, then again, consider two subcases. If $m$ and $n$ have a common divisor, it is again easy to see that the function is not surjective (why?)

*The only remaining case is that $m\neq 0$ and $\mathrm{GCD}(m,n)=1$. In that case, I would use the fact that if the GCD of $x,y$ is $1$, then there exists, for every $M$, exactly one pair $a,b$ such that $ax+by=M$. It should be possible to prove that in this case, the function also cannot be surjective.

EDIT:
Your proof of surjectivity is still flawed. It has the right idea, but needs more structure.

Case 1) Let $m=0$. Then $f(x)=-nx$. Suppose $f(a)=b$. Then $-na=b \iff a=-\frac{b}{n}$. For the function to be subjective, $n$ must be equal to either $1$ or $-1$. Otherwise, $a$ will not be in the codomain $\mathbb{Z}$.

The reasoning above is wrong. It is perfectly possible for $\frac bn$ to be in the domain of $f$. For example, if $b=4$ and $n=2$, then $a=2\in\mathbb Z$.
What you need to do to prove that the function is not surjective is this:

There exists some $b\in\mathbb Z$ such that, for all $a\in\mathbb Z$, we have $f(a)\neq b$.

For case 2, you didn't really prove anything as well.
