For any $(a,b)\in {Y}_{n}$, let $f((a,b))=f(a,b)=an+b.$ Prove that $f$ is a bijection and find its inverse ${f}^{-1}$.

How to find an inverse of this multivariable function. I was already able to prove that $f(a,b)=an+b$ is a bijection, but not certain how to find its specific inverse. It would be important to note that ${Y}_{n}={X}_{n}\times {X}_{n}$ where ${X}_{n}=\{0,1,2,...,n-1\}$.