Lua, 8 bytes
f=load''
Defines a (global) function f
.
This uses Lua load
function to compile given string which happens to be empty in our case (empty code is valid code) into function which does exactly what we wrote in its body: nothing.
For ones wondering, standard solution would be
function f()end
but this is longer (15 bytes).