I see, acouple of doubts though,
Isn't the integral of zero a constant that depends on the boundary conditions? And are there not situations where integrating over infinity is not meaningless (like Ben did when integrating the boundary term)?
No, this is a definite integral, so no constant.
As I said, the problem is that you would have to make sense out of the curvature being a delta function.
It must be that people have thought about things like that, but I don't know how to do it. Black holes have singularities in them, so I imagine it's something like that. But then, that singularity can't be part of the Lorentzian manifold, so it's just like the situation here. Actually, with black holes, I guess the curvature will not exactly be a delta funtion, but I could imagine maybe you would want some kind of Green's function or something like that that solves the Einstein equation when the source is a delta function.
Here's a paper where it sounds like they do something like that, but I just read the abstract.
Ok, let's say it is not compact, then a problem arise with the gauss-bonnet formula if we say there is no boundary term, how do we get an Euler charachteristic of one (that of a plane)?
Gauss-Bonnet is for CLOSED (compact with no boundary) surfaces, so it doesn't apply to the plane.