f[x_]:=(x^2-x-2)/(x-6)
Factor[f[x]]
Solve[f[x]==0,x]
Plot[{f[x],x+5},{x,-2,8},PlotRange->{-5,5}]
Plot[{f[x],x+5},{x,-2,8},PlotRange->{-50,50}]
Plot[{f[x],x+5},{x,-100,100},PlotRange->{-500,500}]

f[x_]:=(4x-4)/(x+2)
Solve[f[x]==0,x]
Plot[{f[x],4},{x,-8,8},PlotRange->{-5,15}]

f[x_]:=(2x*(x+2))/((x-1)(x-4))
Solve[f[x]==0,x]
Plot[{f[x],2},{x,-8,8},PlotRange->{-15,15}]
Plot[{f[x],2},{x,-18,18},PlotRange->{-15,15}]
Plot[{f[x],2},{x,-180,180},PlotRange->{-15,15}]