Let X be a metric space, p ∈ X, and let K ⊂ X be compact. Show that there exist x0, x1 ∈ K such that d(x0, p) ≤ d(x, p), ∀ x ∈ K, d(x1, p) ≥ d(x, p), ∀ x ∈ K.
I know that I have to show the distance function is contunous and since its domain is compact, the range of a contunous function is compact. Thus, it has a minimum and maximum because it's closed. But not sure how to construct the proof.