This might seem like a stupid question (and I think it is), but I have been unable to gain intuition on this, or a solid proof. So far while studying number theory, I have seen the general solution for solving modular congruencies like:
$$x^2 \equiv 3 \mod{5}$$
Or, $$5x \equiv 11 \mod{19}$$
Solved by checking all the values of $x$ from $\{0, 1, ....., m-1\}$. If no solution appears in that set, then the modular congruency has no solution, else it does.
Why is this necessarily true? I have a slight intuition that for any $x$ where $x \geq m$, the mod cycle just wraps around to some number $x_0 < m$, but I don't feel this is solid justification. I guess, extended, is it true that:
$$f(x) \equiv r \mod{m}$$
Only has a solution if where $x =\{0, 1, ..., m-1\}$ has solution?
Use the binomial theorem: if you replace one of those things, $r\in\{0,1,\ldots, m-1\}$ by $r+km$ then how does this affect a polynomial? Well monomials go like this
so that since any multiple of $m$ is just $0$ mod $m$, we see that $(r+km)^j\equiv r^j\mod m$. Similarly for entire polynomials as with $p(x) = \displaystyle\sum_{n=0}^Na_nx^n$ then
$$p(r+km)=\sum_{n=0}^N a_n(r+km)^n\equiv \sum_{n=0}^N a_nr^n\equiv p(r)\mod m$$
so really all you have to do is check that set, since congruences are equivalence relations.