Suppose that z belongs to both F and K. Then ||z-z||=0 thus d=0.
Now if d=0 then for each positive integer n, there are points in K, k_n, and f_n in F such that ||k_n – f_n||<(1/n).
By the compactness of K the sequence (k_n) converges to a point in K, k, but k is a limit point of F and because F is closed k belongs to F.
(You may have to be more careful picking the points, but that is the general idea.)