Affine encryption function
Let $n$ be the modulus and $d = \gcd(a,n)$. Then, $ax \mod n$ will be a multiple of $d$. If $d &gt; 1$, this implies that there is no $x$ such that $ax \equiv 1 \pmod n$, and so there is no $x$ such that $f(x) = ax+b \equiv b+1 \pmod n$. So $f$ is not a bijection since it is not surjective.

P.S.: I am not certain how you got the idea of using the word "field" instead of "set", but you should refrain from using it until you have learned what a field is.