We have a metric space $(X,d)$ and $Y \subset X$, then the Hausdorff Metric is defined as the following: $$d(x,Y)=\inf_{y \in Y}d(x,y), \ \ x \in X$$
I have to show that if $Y$ is compact, then $d(x,Y)=\min_{y \in Y}d(x,y), \ \ x \in X$ i.e. the infimum is attained at some $y \in Y$.
I'm having trouble understanding how to proceed, any hints will be appreciated!
Edit: (Thanks to the comments on this question, I have edited my answer)
Let's have $D_x := \{d(x,y):y\in Y\}$ $$d_x:Y \rightarrow \mathbb{R}, \ y \mapsto d(x,y)$$
Both are topological spaces apropos their induced topology, and the map satisfies the sequential definition of continuity i.e. consider a converging sequence in $Y$, say $y_n \rightarrow y$, then clearly $d(x,y_n) \rightarrow d(x,y)$. Since we have the fact that continuous image of a compact set is compact, we have $D_x = d_x(Y)$ as compact in $\mathbb{R}$, and hence closed and bounded. Therefore, it attains it's infimum (and supremum).