#f(x)=(x-4)/(x+2)# is defined for all Real values of #x# except when #(x+2)=0#

#color(white)("XXX")rarr# except for #x=-2#

So the Domain is all #RR# except #(-2)#

To find the Range consider #barf(x)#, the inverse of #f(x)#

By definition of inverse

#color(white)("XXX")f(barf(x))=x#

and therefore

#color(white)("XXX")(barf(x)-4)/(barf(x)+2)=x#

#color(white)("XXX")barf(x)-4 = x*barf(x)+2x#

#color(white)("XXX")barf(x)-xbarf(x)= 2x+4#

#color(white)("XXX")barf(x)(1-x) = 2x+4#

#color(white)("XXX")barf(x)=(2x+4)/(1-x)#

Which is defined for all values of #x!=1#

That is the Domain of #barf(x)# is #RR-{1}#

and

Since the Domain of a function is the Range of its inverse

#color(white)("XXX")#the Range of #f(x)# is #RR-{1}#