Prove that for any subset A ⊆ ℝ, the distance between a point x and the set A, defined as d(x, A) = inf{d(x, a) : a in A}, is attained in A if A is closed.