My book defines $a\equiv b\pmod n$ as $n|b-a$ where $a, b, n$ are integers.
I want to know that if $a\equiv b\pmod n$ then how is $b$ the remainder of $a$ when divided by $n$ if $b$ is less than $n$?
$a \equiv b\pmod n$ means $n|b-a$ which further implies that $b-a = nq$ for some integer $q$.
Now if $r$ is the remainder when $a$ is divided by $n$. Then there will exist $p$ such that $a = np+r$ which implies $b = a-np$.
From here, how can I conclude that $q = -p$?
You mention 'there will exist $p$, there will exist $q$', which implies that p and q are not definite numbers, but elements of sets satisfying certain conditions, say $X$ and $Y$.
so you can't get $p=-q$, but $p, -q$ both belong to the same set, i.e. $X=Y$ (which is actually $\mathbb{Z}$).
So basically you mix up equality of sets with equality of numbers.