Let's take two real numbers $a,b$. The distance between $a$ and $b$ is $|a-b|$. Let $\{\}$ denote fractional part. Then for any $a$ and $b$, there is an integer close to $|a-b|$ which is at most $|\{a\} - \{b\}|$ away from $|a-b|.$
We can see this intuitively but I just want to know what proof technique can be used and how to prove the above statement?
We may assume that $a \leq b$, so that $| a - b | = b-a$. Consider $n = (b - \{b\}) - (a - \{a\})$. Then $n$ is an integer and we have $$|n - |a - b|| = |n - b + a| = |\{a\} - \{b\}|,$$ as desired.