How can I find the numbers who are their own multiplicative inverse in mod m where m is not necessarily prime?

Can I find the solutions, or number of solutions for $$a^2 \equiv 1\ (mod\ m)$$ where m is not necessarily prime?

• Welcome to MSE. Did you mean $a^2\equiv1\pmod m$? – José Carlos Santos Oct 15 at 6:41
• @JoséCarlosSantos Yes I did... thank you very much. – October15 Oct 15 at 6:43
• Using Chinese Remainder Theorem reduces the problem to prime power $m$. – Lord Shark the Unknown Oct 15 at 6:46
• @LordSharktheUnknown Got it. Thank you! – October15 Oct 15 at 6:58