Your example represents a practice which is best avoided. Namely, making a function implicitly depend on some variable is an invitation for trouble. Please read this answer for a partial explanation of why.
The semantics of parameter-passing in Mathematica was described e.g. here. What happens is that the value of the parameter is literally injected into the body prior to the execution of the body. Therefore, in your definition, even if you define
f[y_?NumericQ] := NIntegrate[Evaluate[a*z*y], {z, 0, 1}]
the following will happen when you pass a value (say, call f[5]):
f[5] --> NIntegrate[Evaluate[a*z*5],{z,0,1}]
meaning that the binding of y to 5 happens in any case before the body executes, so a has no chance to fire. Therefore, NIntegrate does not know about the relation between a and the actual value of y you passed, and computes a to symbolic y during evaluation.
One possible way out is to define something like this:
f[y_?NumericQ] :=
With[{a = y}, NIntegrate[a*z*y, {z, 0, 1}]]
This will work as expected. However, better still would be to only use in the r.h.s. of a function the parameters that you pass explicitly. Here this would look something like
ClearAll[a, f];
a[y_] := y;
f[y_?NumericQ, a_] :=
NIntegrate[Evaluate[a[y]*z*y], {z, 0, 1}]
so that
f[5, a]
(* 12.5 *)
Position- the latter took him just 5 mins!). – Leonid Shifrin Mar 21 '13 at 13:26Positionwas - you managed to write a full-fledged answer with links and formatting etc, citations from docs - in under 5 minutes. – Leonid Shifrin Mar 21 '13 at 14:06