If $xy \equiv 1 \pmod a$, can I write $x \equiv \frac{1}{y} \pmod a$.
I was thinking about this while solving IMO 2005 P4, so in particular can I write $$2^{p-2} + 3^{p-2} + 6^{p-2}\equiv\frac{1}{2} + \frac{1}{3} + \frac{1}{6} \pmod p?$$
If $xy \equiv 1 \pmod a$, can I write $x \equiv \frac{1}{y} \pmod a$.
I was thinking about this while solving IMO 2005 P4, so in particular can I write $$2^{p-2} + 3^{p-2} + 6^{p-2}\equiv\frac{1}{2} + \frac{1}{3} + \frac{1}{6} \pmod p?$$
As long as $\gcd(a,y)=1$, yes, you could. If not, then you can't.
Find some integer solution to $my+na=1$, say by the extended Euclidean algorithm. Modulo $a$ this yields $my\equiv 1$, which means that $m$ corresponds to $\frac 1y$.
As noted in the comments above, though, it is more common in modular arithmetic to write $y^{-1}$.