f(x)=-x^2+2x+1=-x^2+2x-1+2=2-(x-1)^2.
Since, x can take any value from RR, we find that the Domain of f=D_f=RR.
Now, we notice that, AA x in RR, (x-1)^2>=0 rArr -(x-1)^2<=0, and, adding 2, 2-(x-1)^2<=2, i.e., f(x)<=2, or, f(x) in (-oo,2].
Now, the Range of f =R_f={f(x): x in D_f=RR},, it will be clear from above , that R_f sube (-oo,2].
Our next goal is to show that (-oo,2] sube R_f., which, altogether, will prove that R_f= (-oo,2].
To this end, let y in (-oo,2], y arbitrary. We will show that, corresponding to this y, EE at least one x in D_f=RR, such that, f(x)=y, meaning that y in R_f.
define x by, x=1+sqrt(2-y). As y in (-oo,2], y<=2, (2-y)>=0, & hence, x=1+sqrt(2-y) does exist in RR
It remains to be shown that f(x)=y, which is done as below:-
f(x)=2-(x-1)^2=2-{(1+sqrt(2-y))-1}^2=2-(sqrt(2-y))^2=2-(2-y)=y.
Hence, the Proof that R_f=(-oo,2].
I hope, this will be helpful! Enjoy maths.!