To restrict a function, e.g. f(x) = x^2 to the interval [-2,2], you can use Function[f,-2,2]. More complex restrictions may be achieved with If[…].
f(x) = x^2
[-2,2]
Function[f,-2,2]
If[…]