Q:

Why do materials obey Hooke's law?

Why do materials extend proportionally to the force exerted on them (Hooke's law)? I thought that 

when materials are compressed or extended under force, their atoms become closer or further apart; 
the inter-atomic forces are essentially electrostatic; 
electrostatic forces (and indeed most other forces) follow an inverse-square law;

So I would naively conclude that springs should follow an inverse square law. 
But clearly in most situations the law is linear.  Where is my logic flawed?

A:

When one considers a relatively small segment of a curve, most appear approximately linear when one zooms in far enough. Most materials are not truly linear when stretched a considerable distance, but for small deviations about the equilibrium some are approximately linear. This can be seen when one considers Taylor Series expansions of functions.
The inverse square law for electrostatics can be expanded as a Taylor Series as well, and it contains a linear component as can be seen here:
$$\frac{1}{(r-r_0)^2}=\frac{1}{r_0^2}\left[1+2\left(\frac{r}{r_0}\right)+3\left(\frac{r}{r_0}\right)^2+4\left(\frac{r}{r_0}\right)^3+\cdots\right]\,.$$
For small deviations $\Delta r\approx0$, the inverse square law is approximately linear since the higher-order terms $\mathcal{O}[(\Delta r)^2]$ fall off very quickly. This can be seen using the Binomial approximation $(1+x)^n\approx1+nx$ where $x\approx0$. In this case we have:
$$(\Delta r-r_0)^{-2}=\frac{1}{r_0^2}\left(1-\frac{\Delta r}{r_0}\right)^{-2}\approx\frac{1}{r_0^2}\left[1-(-2)\left(\frac{\Delta r}{r_0}\right)\right]=\frac{1}{r_0^2}\left[1+\frac{2\Delta r}{r_0}\right]\,.$$
Of course this is far too simple to describe the more complex material effects of crystal lattices being stretched from equilibrium, but this is the general idea of how many materials can exhibit linear relationships between force and distance for small deviations from equilibrium.

