The additive inverse of 5 modulo 8 is the number a such that
5 + a ≡ 0 (mod 8)
Then
a ≡ -5 ≡ -5 + 8 ≡ 3 (mod 8)
The multiplicative inverse is m such that
5m ≡ 1 (mod 8)
Use the Euclidean algorithm:
8 = 1•5 + 3
5 = 1•3 + 2
3 = 1•2 + 1
Then
1 = 3 - 1•2
1 = 3 - 1•(5 - 1•3) = 2•3 - 1•5
1 = 2•(8 - 1•5) - 1•5 = 2•8 - 3•5
and so
1 ≡ 2•8 - 3•5 ≡ (-3)•5 (mod 8)
which means the inverse of 5 is
-3 ≡ 8 - 3 ≡ 5 (mod 8)