Show that the extension of $f : S → \mathbb{R}$ to the closure of its domain, $\overline{S}$, is unique
To define $\bar f(\hat x)$, pick any sequence $x_n\to \hat x$ and let $\bar f(\hat x)=\lim f(x_n)$. As you said, this limit exists because $f$ is uniformly continuous.
This $\bar f$ is well-defined, i.e., does not on the particular choice of sequence(s); this is simply because the if we combine tqo sequences $x_n\to\hat x$ and $y_n\to \hat x$, we get another convergent sequence. The function values of this converge, but as $f(x_n)$ and $f(y_n)$ are subsequences of it, we conclude that that $\lim f(x_n)=\lim f(y_n)$, as was to be shown.
Also, $\bar f|_S=f$. This is clear because we can pick the constant sequence $x_n=\hat x$ for $\hat x\in S$.
Finally, $\hat f$ is uniformly continuous. Indeed, let $\epsilon>0$ be given. As $f$ is uniformly continuous, there exists $\delta>0$ such that $d(x,y)<\delta$ implies $|f(x)-f(y)|<\frac13\epsilon$. Then for $\hat x,\hat y\in \bar S$ with $d(\hat x,\hat y)<\frac 13\delta$, and accordingly sequences $x_n\to x$, $y_n\to y$, we have $|f(\hat x)-f(x_n)|<\frac13\epsilon$ and also $d(x_n\hat x)<\frac 13\delta$, if only $n$ is big enough. Likewise, we have $|f(\hat y)-f(y_n)|<\frac13\epsilon$ and $d(\hat y,y_n)<\frac13\delta$ for all sufficiently large $n$. Then for these $n$, we have $d(x_n,y_n)le d(x_n,\hat x)+d((\hat x,\hat y)+d(\hat y,y_n)<\delta$, hence $|f(x_n)-f(y-n)|<\frac13\epsilon$, hence $|f(\hat x)-f(\hat y)|\le |f(\hat x)-f(x_n)|+|f(x_n)-f(y-n)|+|f(y_n)-f(\hat y)|<\epsilon$, as desired.
Thus we have found a uniformly continuous extension of $f$ to all of $\bar S$.
Looking at the definition, we must have $\bar f(\hat x)=\lim_{n\to\infty}f(x_n)$ whenever $x_n\to\hat x$, or else $\hat f$ cannot be a continuous extension of $f$. As such a sequence $S\ni x_n\to\hat x$ exists for all $\hat x\in \bar S$, ew do not have any choice at all, i.e., our $\bar f$ above is the unique continuous extension.