I'm working with a deferred shading technique. I have diffuse, normal and depth buffers, which I combine for the final scene composition. Where and when exactly do I apply an anti-aliasing pass (such as FXAA)? Just on the color buffer before lighting or any processing? Or as a separate pass on the final scene? Or something in-between?
Techniques like FXAA, MLAA etc. are normally applied almost at the very end of the graphics frame - after all lighting, postprocessing, color correction etc. is complete, but before rendering UI and text (because those normally already have sufficient antialiasing built in to their textures and don't need any more).
Anti-aliasing in a deferred shader is a complex topic. WikiPedia lists a number of techniques for doing anti-aliasing in a deferred-compatible way.
Typically you'll need to do it after lighting, otherwise you can end up with lighting artifacts. Most approaches I know of do another pass on the scene after the entire deferred pipeline is complete.
If you are using more recent hardware and APIs, you can "simply" use multisampled render targets for your color and light buffers (the newer APIs allow you to sample those as needed) at the usual cost of increased memory usage. The other techniques can work with nothing more than a small number of extra buffers/passes and have only compute time costs.