I'll preface my answer by saying that functions are objects in javascript, so we're really talking about object references in general.
You can't actually null the object in memory. You're only setting a reference to the actual object to null. f is a reference to that object, just like a is. You're making a no longer a reference to that object, but that doesn't affect f at all.
The garbage collector will take care of actually removing the object altogether.
In case that's unclear, I'll explain in other words:
var a = {}; makes an object in memory. a isn't actually that object, but a reference to it.
var f = a means that f now references the same object that a references.
a = null; means that a no longer references the object, but doesn't affect the object itself. f still references that object.