The range is the set of values of f(x)f(x) you can get from your domain. So given f(x)=x^2-1f(x)=x2−1 and domain D={-2,-1,0,2}D={−2,−1,0,2}, all you have to do is plug in the elements of your domain into your function.
color(red)(x=-2)x=−2
[1]" "f(-2)=(-2)^2-1[1] f(−2)=(−2)2−1
[2]" "f(-2)=4-1[2] f(−2)=4−1
[3]" "color(red)(f(-2)=3)[3] f(−2)=3
color(blue)(x=-1)x=−1
[1]" "f(-1)=(-1)^2-1[1] f(−1)=(−1)2−1
[2]" "f(-1)=1-1[2] f(−1)=1−1
[3]" "color(blue)(f(-1)=0)[3] f(−1)=0
color(green)(x=0)x=0
[1]" "f(0)=(0)^2-1[1] f(0)=(0)2−1
[2]" "f(0)=0-1[2] f(0)=0−1
[3]" "color(green)(f(0)=-1)[3] f(0)=−1
color(orange)(x=2)x=2
[1]" "f(2)=(2)^2-1[1] f(2)=(2)2−1
[2]" "f(2)=4-1[2] f(2)=4−1
[3]" "color(orange)(f(2)=3)[3] f(2)=3
Now that you have solved for all the possible values of f(x)f(x), your range is:
R={-1,0,3}R={−1,0,3}