First of all, this is a polynomial, not a rational function (which has x in denominator(s)). Please post your problems in a relevant category.
And yes, you will divide. Synthetic division is easiest:
2 | 1 -k k 2
--- 2 4-2k 8-2k
--------------------
1 2-k 4-k 10-2k
Since x-2 is supposed to be a factor, then we should get a remainder of zero when we divide. The remainder we got, 10-2k, must then be zero:
10-2k = 0
Adding 2k:
10 = 2k
Dividing by 2:
5 = k
This is the value for k that makes x-2 a factor of f(x).