The question is a little bit unclear (you have to specify what limit you are taking when you say $|x-y|\to 0$ ), but I will try to answer anyway.
By definition, a univariate real function is uniformly continuous on a subset $A$ of the reals with respect to the usual metric if for every $\varepsilon > 0$ we can choose $\delta > 0$ such that
\begin{equation*} |f(x)-f(y)| < \varepsilon \end{equation*}
whenever $x,y \in A, |x-y| < \delta$.
Now if by $|x-y| \to 0$ you mean that $y$ tends to $x$, you are basically asking to prove that
\begin{equation*} \lim_{y \to x} |f(x)-f(y)| = 0 \end{equation*}
for the right arrow, that is, by the definition of limit
\begin{equation*} \forall \varepsilon > 0 \exists \delta > 0 \forall y |x-y| < \delta \implies |f(x)-f(y)| < \varepsilon \end{equation*}
that holds by the definition of uniform continuity. Note that $x$ is a constant in the preceeding equation.
The other arrow is not true, I will give a counterexample.
Let $f: (0,1) \to \mathbb{R}$, $f(x)=\frac{1}{x}$, $f$ is obviously not uniformly continuous, but it is indeed continuous, hence, for every $x \in (0,1)$
\begin{equation*} \lim_{y \to x} |f(x)-f(y)| = |\lim_{y \to x} f(x)-f(y)| = |f(x) - \lim_{y \to x} f(y)| = |f(x)-f(x)| = 0 \end{equation*} by the continuity of the absolute value and of $f$.
Note that you are basically trying to prove that uniform continuity is equivalent with ordinary continuity if every point of the set is an accumulation point (so that you can always take the limit at $x$) (in fact in the first part of the proof I have proved that uniform continuity implies continuity on such a set, because $\lim_{y \to x} |f(x)-f(y)| = 0 \Longleftrightarrow \lim_{y \to x} f(y) = f(x)$), and this is not true at all.
It is true anyway that if the set $D$ you are considering is compact, then continuity and uniform continuity are equivalent.
This is known as Heine-Borel theorem, and it applies even to general metric spaces.