Math9999 said:
And what about problem like 6x=5 in ℤ8?
Consider more generally two cases.
##6\cdot 4 \equiv 0 \operatorname{mod} 8##. Now try to find out, whether such an element can have an inverse or not. What will happen if there is an element ##a## for which there are elements ##x,y## with ##a\cdot x = 0## and ##a\cdot y = 1##. Can this happen?
Now even if ##6 \in \mathbb{Z}_8## had no inverse, there could still have been an element ##x## with ##6\cdot x \equiv 5 \operatorname{mod} 8##. But we can solve it the same way, we would solve it with integers. If ##6## has no inverse, we will not be allowed to divide by ##6##. But ##5 \cdot 5 \equiv 25 \equiv 1 \operatorname{mod} 8## so we can divide by ##5##. The inverse element to ##5## is also ##5##, so
$$5 \cdot 6 \cdot x \equiv 5 \cdot 5 \equiv 1 \operatorname{mod} 8
\;\;\text{ and } \;\;
5 \cdot 6 \cdot x \equiv 30\cdot x \equiv 6 \cdot x \operatorname{mod} 8
$$ Thus the equation ##6\cdot x \equiv 5 \operatorname{mod} 8## is solvabel if and only if ##6 \in \mathbb{Z}_8## has an inverse, which we dealt with in the first part.
The moment you forget about divisions and consider them as what they are, multiplications, you can calculate like you're used to. The only advice here is, that it is better to write a little more and do a little less in mind to avoid mistakes.
And of course we can always write down the multiplication table and see which multiples of ##6## lead to ##5##, which is the boring way and not practicable in say ##\mathbb{Z}_{186}##.