If the objective here is to get rid of the declaration then the
utility
function Recall defined in the first line below would allow you to do
it.
It calls the function n levels up on the stack so if f calls g and
g which calls Recall(2) then Recall(2) returns the function f.
Recall = function(n) return debug.getinfo((n or 1)+1,"f").func end
local g = function(x)
if (x > 0) then return x + Recall(2)(x-1) else return 0 end end
local f = function(x)
if (x > 0) then return x + g(x-1) else return 0 end end
print(f(3))