For how many integers $a$ satisfying $1 \le a \le 23$ is it true that $a^{-1} \equiv a \pmod{24}$?
Sorry I was going to post an answer to this, but it got deleted when I tried submitting :(. I only got through part of this, but I'll try uploading a new answer tomorrow. In the meantime, try searching up "bezouts identity" and its relation with fractional modulo. What can you immediately realize won't satisfy the requirements of the given expression?(Hint: it has something to do with the denominators being coprime to the modulus).