Answer
See the explanation below.
Work Step by Step
If we want $f$ to be discontinuous at 2, we make $f(2)$ undefined.
The easiest way is to place $(x-2)$ in the denominator.
We now define $f$ in such a way that it has a limit at x=2, by
choosing a numerator that we can factor so it cancels the denominator. We do this if we want a removable discontinuity.
For example, let the numerator = $x(x-2)=x^{2}-2x$.
So,
$f(x)=\displaystyle \frac{x^{2}-2x}{x-2},\ \displaystyle \quad\lim_{x\rightarrow 2}f(x)=\lim_{x\rightarrow 2}\frac{x(x-2)}{x-2}=\lim_{x\rightarrow 2}x=2$.
The discontinuity can be removed by redefining $f$
$f(x)=\left\{\begin{array}{lll}
\dfrac{x^{2}-2x}{x-2} & if & x\neq 2\\
2 & if & x=2
\end{array}\right.$