I have been looking at $x^2 - x \equiv 0 \pmod 6$. Factoring $x^2 - x$ yields:
$$x^2-x = x(x-1)$$
Solving $x(x-1) \equiv 0 \pmod 6$ implies $x \equiv 0$ or $x \equiv 1 \pmod 6$. However, these are not all the solutions. As it turns out, $x \equiv 3$ and $x \equiv 4 \pmod 6$ are also solutions. Plugging $3$ and $4$ it is easy to see that indeed $4 \cdot 3 \equiv 0 \pmod 6$.
However, it is not immediately obvious. My question is how to find these non-trivial solutions? Is there a good technique? What if $6$ was replaced by a relatively larger composite number? I can see solving the equations in prime factors could be one way. But I am interested to know if there are methods without needing to find prime factors.