f(x)=(mx+2)/((2-m)x+2m).
When the denominator is a multiple of the numerator:
(2-m)x+2m=p(mx+2),
2x-mx+2m=pmx+2p,
2-m=pm, m=p (equating coefficients),
2-m=m2, m2+m-2=0=(m+2)(m-1), so m=-2 or 1 gives us a linear function (horizontal line). Hence:
When m=1, f(x)=(x+2)/(x+2)=1 which is a linear function (horizontal line).
When m=-2, f(x)=(-2x+2)/(4x-4)=-½ which is a linear function (horizontal line).
When m=2 the denominator becomes a constant so f(x) is linear: f(x)=(2x+2)/4=½(x+2).
Other values of m produce hyperbolas.