$(a)$ $f(m,n)=2m-n$ is not one-to-one $f(2,2) = 2 = f(3,4)$ also for every $x \in Z$ there exist some m,n which generate x from $f(m,n)$, let x = 3, $2m - n = 3$ $2m = 3 + n$ now substitute any value of m and n that satisfies the equation so it is onto $(b)$ $f(m,n)=m^2 - n^2$ if x = 2 then there exist no m and n to satisfy this equation, $1^2 - 0 = 1$ and $2^2 - 1^2 = 3$ clearly not onto now $f(1,0)$ = 1 = $f(-1,0)$ so it is also not one to one.
yes 1st one is one to one and onto
2nd one is not onto and many to one
https://math.stackexchange.com/questions/4467/how-to-prove-if-a-b-in-mathbb-n-then-a1-b-is-an-integer-or-an-irratio