How many solutions does $x \equiv x^{-1} \pmod n$ have?
$n$ is defined to be a positive integer,
What I believe the solution will be is along the lines of 2 cases:
When $n = 1$, the set of solutions will just be $x \in \mathbb Z$ because $x \equiv x^{-1} \pmod 1$ can be rewritten as $x - x^{-1} \equiv 0 \pmod 1$ and mod 1 of any integer will always reduce to 0
When $n \gt 1$, I know we have to apply Chinese Remainder Theorem somehow, I just do not know how to approach this though. We can claim by the Fundamental Theorem of Arithmetic that $n = p_{1}^{k_{1}}p_{2}^{k_{2}}...p_{l}^{k_{l}}$ where $p_{i}$ are prime numbers. How would I continue?$\\$ I thought maybe multiplying both sides by $x$ and rearranging to get $x^{2} \equiv 1\pmod n$ could be of some help but I couldn't get any further.