I don't really have an idea on how to prove this.
My thinking:
$f(x,y) = ax+by = \gcd(a,b) = 1$ by Bézout's identity.
To prove a function is surjective: Let $f(x,y)=m, m\in \mathbb{Z}$
Then prove $\exists x,y \in \mathbb{Z} \times\mathbb{Z} $ such that $f(x,y) = ax+by=m$
Though I don't quite understand how $\gcd(a,b)=1$ is relevant to all of this. I've looked at other answers on this fourm but none make sense at all really. I know $ax+by=1$ has something to do with this but I don't quite know what. Any help would be appriciated!