Should a pure function take all of the functions it calls as arguments?

After Wikipedia, if a function is pure, then:

[it] always evaluates the same result value given the same argument value(s).

So: if a function, let's call it f, calls another function, g, then it's behavior clearly depends on the structure of the function g. Should f take g as an argument in order to be pure?

• This is probably opinion based, but if I were to write down the semantics, each function would get an implicit argument with the environment where it can look up things like the function $g$. – adrianN Jul 26 '16 at 10:05
• I'm not sure what computation context you're considering, but usually g would be free inside of f. It wouldn't be an argument though, at least not in the traditional meaning of the word – pdexter Jul 26 '16 at 13:49

No, f doesn't have to take g as an argument. Wikipedia's definition is a bit informal. Also informally, the behavior of a pure function is also allowed to depend on the code of the program. Or, to put it another way, the code of the program is considered fixed, not something we vary, so we don't try to track dependences on it.
So, something like f(x) = 2*g(x) is fine: if g is pure, f will be too.
The fact that f calls g doesn't influence the purity. All that's required is that for a given input to f, f always returns the same output. That means g must be pure. It also means if someone changes g so it's impure, then f becomes impure, too. But at that point it's a different function.