If we define a function something like
(defun foo(x) (setf x somevalue))
Is x defined as a local variable or global? using setf/
x
In your code x is a parameter to the f function and thus local to the function. The call to setf does not create new variable, but simply sets the value of the existing local variable x. Using setq instead of setf would behave the same.
f
setf
setq