$5$ divides $2ax+b$ for some integer $a$,given $5$ does not divide $x$ $x$ and $b$ are given.Let,$5$ does not divide $x$.
Then $5$ divides $2ax+b$ for some integer $a$.
How do i prove this? I have not gone through a course in number theory,so a general proof would be appreciated.

The slightly stronger statement holds true that $\,2ax+b\,$ is a multiple of $\,5\,$ for an $\,a \in \{0, \pm 1, \pm 2\}\,$.
If $\,b\,$ is a multiple of $\,5\,$ then $\,2 \cdot 0 \cdot x+b=b\,$ is a multiple of $\,5\,$, so $\,a=0\,$ works.
Otherwise, note first that if $\,u\,$ is not a multiple of $\,5\,$ then $\,u^4 = \mathcal{M}5+1\,$ where the notation $\,\mathcal{M}5\,$ denotes any integer multiple of $\,5\,$. This follows directly from Fermat's little theorem, but is also easy to prove in this case, as to keep the answer self-contained and largely number-theory-free. Any number $\,u\,$ which is not a multiple of $\,5\,$ must be in one of two forms:


*

*if $\,u=\mathcal{M}5 \pm 1\,$, then $\,u^2= (\mathcal{M}5)^2 \pm 2 \cdot \mathcal{M}5+(\pm 1)^2 = \mathcal{M}5+1\,$, then $\,u^4=\left(u^2\right)^2$ $=\mathcal{M}5+1\,$ by the same argument;

*if $\,u=\mathcal{M}5 \pm 2\,$, then $\,u^2= (\mathcal{M}5)^2 \pm 4 \cdot \mathcal{M}5+(\pm 2)^2 = \mathcal{M}5+4 = \mathcal{M}5 - 1\,$, then $\,u^4=\left(u^2\right)^2$ $=\mathcal{M}5+1\,$ by the same argument as above.
Then what remains to be proved is that one of the numbers obtained for $\,a \in \{\pm 1, \pm 2\}\,$ is a multiple of $\,5\,$. Those numbers are $\,b-4x, b-2x, b+2x, b+4x\,$, and their product is:
$$
(b^2-4 x^2)(b^2-16 x^2) = b^4 + 64 x^4 - 20 b^2x^2 = b^4 -x^4 + 65 x^4 - 20 x^2b^2 = b^4 - x^4 +\mathcal{M}5
$$
But neither of $\,b, x\,$ is a multiple of $\,5\,$, so $\,b^4-x^4=(\mathcal{M}5+1)-(\mathcal{M}5+1)=\mathcal{M}5\,$, and therefore one of the factors $b-4x, b-2x, b+2x, b+4x$ must be a multiple of $\,5\,$.
