Finding inverse inside a field

I am using euclidean algorithm to find if 7 inverse exists in mod12

I ended up with

1=3(12)-5(7)

So the inverse of 7 is -5

and this is what the instructor wrote in the notes but he went from

7^-1=5(mod12)

to

7^-1=7(mod12)

what happened here and how did he end up with 7 inverse being 7 in the field of mod12????

Re: Finding inverse inside a field

We have $\displaystyle 7\equiv-5\pmod{12}$ because 7 - (-5) is a multiple of 12 (or, 7 = -5 + 12). On the other hand, $\displaystyle 5\not\equiv-5\pmod{12}$. So indeed, $\displaystyle 7\cdot 7=49=4\cdot12+1\equiv1\pmod{12}$.