I've been having a discussion with my friend about scoping rules in mathematical syntax. By scoping I mean a set of rules that define how variable and function names could be chosen so that at any given point no name used is ambiguous. As I'm a programmer, the concept of scoping feels very natural to me, so I started wondering whether there are some strict rules of such kind defined for mathematical syntax. If so, what are they?
The actual problem we've been arguing about with my friend was whether arguments of a function should be considered "global" or "local". Is the following notation correct (unambiguous)?
f(x) = x + 3; x ∈ ℝ
g(x) = 2x + 7; x ∈ ℤ
I believed it was, because x, as an argument, only has its meaning in the context of a function. My friend could not agree with that - he considered x "global" and therefore understood this snippet as some nasty and obviously incorrect attempt to double-define the domain of f and g. Do any standarized rules exist to support either claim?