Let \(n \) be a positive integer greater than or equal to \(3\). Let \(a,b\) be integers such that \(ab\) is invertible modulo \(n\) and \((ab)^{-1}\equiv 2\pmod n\). Given \(a+b\) is invertible, what is the remainder when \((a+b)^{-1}(a^{-1}+b^{-1})\) is divided by \(n\) ?
I have never studied modulo mathematics except by looking at the odd question on this forum.
My setting out will be very poor but my logic should be ok.
\((ab)(ab)^{-1}\equiv 1\mod n\\ so\\ 2ab\equiv 1\;\;\mod n\\ 2\equiv \frac{1}{ab}\;\;\mod n\\~\\ \frac{1}{a+b}(\frac{1}{a}+\frac{1}{b})\mod n\\~\\ \equiv \frac{1}{a+b}(\frac{a+b}{ab})\mod n\\~\\ \equiv \frac{a+b}{ab(a+b)}\mod n\\~\\ \equiv \frac{1}{ab} \mod n\\~\\ \equiv 2 \mod n\\~\\ \)