Examples of loss of regularity by "creation of topology" I would like to have a list as general as possible of examples of situations where the density of smooth objects into some "natural class" (the meaning of "natural" depending on the problem considered) fails, giving rise to interesting topological classifications. What comes to my mind are the following famous facts:
1) The condition for $C^\infty(\mathbb R^k, M^n)$ to be dense in the manifold-valued Sobolev spaces $W^{1,p}(R^k, M^n)$, is that the homotopy group $\pi_{[p]}(M)$ should be trivial.(Hang-Lin)
[this was kind of general, but gives the idea of what I'm looking for, maybe!]
2) A map $u$ in $W^{1,2}(B^3,S^2)$ is in the closure of $C^\infty(B^3, S^2)$ if and only if for any $2$-form $\omega$ on $S^2$ such that $\int_{S^2}\omega\neq 0$ one has $d(u^*\omega)=0$.(Bethuel-Coron-Demengel-Helein)
3) In $4$ dimensions, if the Yang-Mills functional is finite on a connection $A\in L^2(M^4)$, then the curvature $F_A$ of $A$ realizes an integral Chern class (i.e. the number $c_2(A):=1/(8\pi^2)\int_{M^4}Tr(F_A\wedge F_A)$ is an integer).(Uhlenbeck)
(Maybe I could also formulate the question differently, asking for mathematical situations having the "loss of differentiability" via "creation of new topology" analogous to the list above.)
 A: I imagine my answer will look a bit strange, but I think it fits the title of your question (may be not really what you had in mind), although it is more a description of a situation where the failure of density is used to create new objects rather than a new topological classification.
I try with some motivation. In (cyclotomic) Iwasawa theory one naturally finds algebraic objects of arithmetic interest (typically, some cohomology group of some kind of arithmetic/geometric creature) to which one would like to attach an analytic object, called $p$-adic $L$ function which should remember very well, or know a lot, about the algebraic object. The way this is achieved is


*

*Realize that the algebraic object $X$ you have in your hands is module over $\mathbb{Z}_p$

*There is a topological group $\Gamma$ which is procyclic (projective limit of finite cyclic groups) acting continuously on  $X$: by some easy commutative algebra, this says $X$ is a module over $\mathbb{Z}_p[[T]]$

*Observe that power series in $\mathbb{Z}_p[[T]]$ are naturally analytic (i.e. admitting a power series expansion...) functions on some $p$-adic space.

*In one way or another, try to attach one function $L_p(X,s)$ in $\mathbb{Z}_p[[T]]$ to your object $X$ by using that the latter object has an action by things which are analytic functions.
Now the application. One would like that the construction above characterizes $L_p(X,s)$ uniquely: for this, the fact that locally constant functions are dense in the algebra of all continuous functions 
$$
f:\Gamma\to\mathbb{C}_p
$$
when endowed with the sup-norm, is a crucial tool (via some kind of $p$-adic Fourier transform). This uniqueness is sometimes true (for instance, if $X$ comes from a modular form which is "ordinary at $p$") but sometimes one needs to allow more general analytic functions than those whose power-series expansion have all coefficients in $\mathbb{Z}_p$ (the case of "supersingular reduction"). In order to produce these "more general" analytic functions, one endows the algebra of continuous functions with a different norm $|\cdot |_r$ (for some $r\in\mathbb{N}$) in which the locally constant ones are not dense anymore – those who becomes dense are the locally polynomial ones with degrees in $[0,r]$. Then, re-transforming back via Fourier, the topological dual of the continuous functions with the norm $|\cdot |_r$ becomes big enough to contain the $p$-adic $L$ function of modular forms with supersingular reduction. A paper where all this is beutifully desxribed is  Colmez' text  on functions of one $p$-adic variable (in French).
Final warning: unfortunately, the connection between the $p$-adic $L$-function one constructs this way and the algebraic object is (often) still only conjectural.
A: Not responding directly to your question, but perhaps suggesting something: to prove that a linear action of a group G on a topological vectorspace V a genuine "representation``, in the sense that G x V -> V is continuous, when V is a space of functions on a space X on which G acts (continuously), usually one wants/shows that continuous compactly-supported functions (or maybe test functions...) are dense in V. 
This fails in simple situations, such as L^\infty on the real line, with the action of \R on itself, for straightforward reasons (not very topological, tho').
So/but, the point is that seemingly natural density claims can fail for simple reasons. 
