Say, a number 6. We know, that the equivalence class will be,
0 -> 0, 6, 12, 18, 24
1 -> 1, 7, 13, 19, 25
2 -> 2, 8, 14, 20, 26
3 -> 3, 9, 15, 21, 27
4 -> 4, 10, 16, 22, 28
5 -> 5, 11, 17, 23, 29
We know, the identity, element is 1, and thus the other numbers in the same row mod 6. If we can take any number here and find an inverse this ab = 1 mod 6, what does those 2 numbers a and b mean with respect to 6? Similarly, what does the product of ab relate to 6? with an example, 5 x 5 = 25, 25 mod 6 is 1. So in other words, what relation does 25 and 6 has? . I am fairly new in this territory or maths for that fact, so this might be very basic for you guys, so don't judge me please :p . The answer would be a mind clearer for me. Thanks :-)
It sounds like you're interested in studying modular arithmetic.
A number $a$ has a multiplicative inverse mod $n$ if and only if $a$ and $n$ are relatively prime. The fact that $5\times5\equiv1$ means that 5 is its own multiplicative inverse. Another way of saying this is that 5 is a square root of unity.
The motivation for modular arithmetic is that $$(xn+a)+(yn+b)=(x+y)n+(a+b)$$ and $$(xn+a)(yn+b)=(xyn+ay+bx)n+ab$$ so, mod $n$, if $a_1\equiv a_2$ and $b_1\equiv b_2$, then $a_1+b_1\equiv a_2+b_2$ and $a_1b_1\equiv a_2b_2$. That is, if we want to know the equivalence class of the output of a sequence of additions and multiplications, we only need to know the equivalence classes of the inputs.
From these observations we can deduce that since $5\equiv-1\pmod6$ and $(-1)^2=1$, we have $5^2\equiv1\pmod6$. More generally, $(n-1)^2\equiv(-1)^2=1\pmod n$.