Answer
$$f\left( x \right) = \frac{{{x^2} - 2x + 1}}{{x - 2}}$$
Work Step by Step
$$\eqalign{
& {\text{Vertical asymptote: }}x = 2 \cr
& {\text{To obtain a vertical asymptote at }}x = 2,{\text{ we must set in the}} \cr
& {\text{denominator of the rational function an expression whose}} \cr
& {\text{real root is }}x = 2,{\text{ then using }}x - 2 \cr
& f\left( x \right) = \frac{1}{{x - 2}} \cr
& {\text{Slant asymptote: }}y = x \cr
& {\text{To obtain a slant asymptote }} \cr
& {\text{ }}f\left( x \right) = x + \frac{c}{{Q\left( x \right)}},{\text{ }}c{\text{ is any constant }} \ne {\text{0}} \cr
& {\text{Let }}Q\left( x \right) = x - 2,{\text{ then}} \cr
& \frac{{P\left( x \right)}}{{Q\left( x \right)}} = x + \frac{c}{{Q\left( x \right)}} \cr
& \frac{{P\left( x \right)}}{{x - 2}} = x + \frac{c}{{x - 2}} \cr
& P\left( x \right) = x\left( {x - 2} \right) + c \cr
& P\left( x \right) = {x^2} - 2x + c \cr
& {\text{Let }}c = 1 \cr
& P\left( x \right) = {x^2} - 2x + 1 \cr
& {\text{Therefore,}} \cr
& f\left( x \right) = \frac{{{x^2} - 2x + 1}}{{x - 2}} \cr} $$