Prove a mod b = b mod a iff a=b
Suppose $a\neq b$. Then, without loss of generality we can assume that $a>b$. In that case $b\pmod a$ is $b$. But $a\pmod b$ is the remainder of $a$ on division by $b$, hence it is less than $b$.
Suppose $a\neq b$. Then, without loss of generality we can assume that $a>b$. In that case $b\pmod a$ is $b$. But $a\pmod b$ is the remainder of $a$ on division by $b$, hence it is less than $b$.