It's generally (3) (interatomic/intermolecular forces of attraction and repulsion) and (4) (none of the above—specifically, entropic forces). In most familiar solids, elasticity is the restoring force toward an energy minimum governed by opposing attractive and repulsive electrostatic forces. In elastomers, however, elasticity arises because there are many more polymer configurations of random disarrangement, and so we see a tendency to return to this state.
(Actually, the most general answer is entropy maximization. I review here why entropy maximization implies energy minimization, and the balance of mechanical forces follows from that. However, entropy maximization is the ultimate reason why anything occurs, so it may be an unsatisfying answer here for its nonspecific nature.)
In most familiar solids, elasticity corresponds to a symmetric energy penalty from deviations to the equilibrium molecular spacing, as governed by the pair potential:
We can obtain Hooke's law of elasticity from this energy penalty. Some notable outcomes are that (1) compressive and tensile elastic moduli are nearly identical (i.e., objects equally resist squeezing and stretching) because any smooth minimum looks like a symmetric parabola up close and that (2) the stiffness is not strongly temperature dependent, as thermal expansion is small in solids.
In contrast, in the ideal elastomer, comprising long, kinked polymer chains, elasticity is completely entropic! (This is also the origin of stiffness in the ideal gas, for similar reasons of noninteraction.) Here, the effects of bond stretching are considered negligible, as bond rearrangement is so much easier. We can stretch the polymer chains to unkink and straighten them, but thermal motion tends to jumble them together again, just as the ends of a light elongated chain on a vibrating table tend to pull together somewhat even though no physical spring connects them. Some notable outcomes here are that (1) Young's modulus is far less than the bulk modulus, corresponding to a Poisson ratio of nearly 1/2, and that (2) the stiffness is strongly temperature dependent because temperature is the conjugate thermodynamic parameter to entropy. See also this answer and this answer. As discussed there, and to sum up, we can write the fundamental relation for an object being stretched with force $F$ as
$$dU=T\,dS+F\,dL,$$
with energy $U$, temperature $T$, entropy $S$, and length $L$. Rewriting, the restoring force from elasticity is
$$F=\frac{\partial U}{\partial L}-T\frac{\partial S}{\partial L}$$
and the spring constant or stiffness $k$ at constant temperature is
$$k\equiv\frac{\partial F}{\partial L}=\frac{\partial^2 U}{\partial L^2}-T\frac{\partial^2 S}{\partial L^2}.$$
Answer (3) corresponds to the $U$ term dominating, with the second derivative corresponding to the curvature at the bottom of the pair potential shown above. Answer (4) corresponds to the $S$ term dominating, with the $T$ coefficient having a prominent impact. Make sense?