Am having a problem trying to quickly spot the inverse of any modulo system of equations. This is that i had in mind...
if i for example had $35^{-1}\pmod 3$, the answer if 2. How we arrive to 2 is i thought that $3 \times 11 = 33$ and remainder is 2.
The same method gives me the right answer on $21^{-1} \pmod 5 = 1$ and $15^{-1} \pmod 7 = 1$
but i don't know why $12^{-1} \pmod 5 = 3$. I mean with the same methodology, the answer would be 2. Am i right or something is going on that i dont understand yet?
When trying to get the modular multiplicative inverse of some number $b$ in $\pmod n$ you're looking for a $b^{-1}$ that satisfies $$b^{-1}b\equiv 1 \pmod n$$
In your case the reason $12^{-1} \pmod 5 \equiv 3$ is because $$12\cdot 3 = 36 \equiv 1 \pmod 5$$ You can only get a modular inverse when $\gcd(b,n)=1$. There are two ways you can get the modular inverse other than guess and check. First is finding solutions to bezouts identity through the extended euclidean algorithm, and the second is eulers theorem.