[This is, except for a few details, same as Carlos Pinzon's answer above]
Let ${ X,Y }$ be metric spaces and ${ A (\subseteq X ) \overset{f}{\to} Y }$ a continuous map. Both ${ d _X, d _Y }$ will be denoted by ${ d }$ for brevity.
The following question arises. Can we impose a "general enough" constraint such that : There is a unique continuous map ${ \overline{A} \overset{\overline{f}}{\to} Y }$ with the property ${ \overline{f} \vert _{A} = f }$ ?
Turns out imposing that ${ f }$ is uniformly continuous and ${ Y }$ is complete will do. Further, in this case ${ \overline{f} }$ is uniformly continuous.
${ \underline{ \textbf{Defining} \text{ } \overline{f} } }$
For every ${ p \in \overline{A}, }$ there exists a seq ${ (x _n) \subseteq A }$ with ${ d(x _n, p) \to 0 }.$
Let ${ p \in \overline{A} }.$ For every ${ n \in \mathbb{Z} _{\gt 0} },$ pick an ${ x _n \in A }$ with ${ d(x _n, p) \lt \frac{1}{n} }.$
So if we ensure that
${ {\color{purple}{(1)}} }$ If ${ (x _n) \subseteq A }$ and ${ d(x _n, p) \to 0 }$ for some ${ p \in X }$ then ${ \lim _{n \to \infty} f(x _n) }$ exists
${ {\color{purple}{(2)} } }$ If ${ \lbrace (x _n) \subseteq A; d(x _n, p) \to 0 \rbrace }$ and ${ \lbrace (y _n) \subseteq A; d(y _n, p) \to 0 \rbrace }$ for some ${ p \in X }$ then ${ \lim _{n \to \infty} f(x _n) = \lim _{n \to \infty} f(y _n) }$
then we can define a map ${ \overline{A} \overset{\overline{f}}{\to} Y }$ naturally by : Let ${ p \in \overline{A} }.$ Pick an ${ (x _n) \subseteq A }$ with ${ d(x _n, p) \to 0 },$ and set ${ \overline{f}(p) := \lim _{n \to \infty} f(x _n) }.$
Ensuring ${ {\color{purple}{(1)} } }$: Let ${ (x _n) \subseteq A }$ and ${ d(x _n, p) \to 0 }$ for some ${ p \in X }.$ So ${ (x _n) }$ is Cauchy. So imposing that ${ f }$ is uniformly continuous ensures ${ (f(x _n)) }$ is Cauchy.
Let ${ \epsilon \gt 0 }.$ Pick ${ \delta \gt 0 }$ such that ${ x,y \in A },$ ${ d(x,y) \lt \delta }$ implies ${ d(f(x), f(y)) \lt \epsilon }.$ Pick ${ N }$ such that ${ d(x _m, x _n) \lt \delta }$ whenever ${ m, n \geq N }.$ Now ${ d(f(x _m), f(x _n)) \lt \epsilon }$ whenever ${ m, n \geq N }.$
Further imposing that ${ Y }$ is complete ensures ${ (f (x _n)) }$ is convergent.
Ensuring ${ {\color{purple}{(2)} } }$: Say ${ f }$ is uniformly continuous and ${ Y }$ is complete, which ensures ${ {\color{purple}{(1)} } }.$ Let ${ (x _n), (y _n) \subseteq A }$ with ${ d(x _n, p) \to 0 },$ ${ d(y _n, p) \to 0 }$ for some ${ p \in X }.$ So ${ \lim _{n \to \infty} f(x _n) = \ell _1 }$ and ${ \lim _{n \to \infty} f(y _n) = \ell _2 }$ exist. We'll show ${ \ell _1 = \ell _2 }.$
As ${ d(\ell _1, \ell _2) }$ ${ \leq \underbrace{ d(\ell _1, f(x _n)) } _{\to 0} }$ ${ + d(f (x _n), f(y _n)) }$ ${ + \underbrace{ d(f(y _n), \ell _2) } _{\to 0} },$ it suffices to show ${ d(f(x _n), f(y _n)) \to 0 }.$
Let ${ \epsilon \gt 0 }.$ Pick ${ \delta \gt 0 }$ such that ${ x,y \in A, }$ ${ d(x,y) \lt \delta }$ implies ${ d(f(x), f(y)) \lt \epsilon }.$
From ${ d(x _n, y _n) }$ ${ \leq d(x _n, p) + d(p, y _n) \to 0 },$ we have ${ d(x _n, y _n) \to 0 }.$ So pick ${ N }$ such that ${ d(x _n, y _n ) \lt \delta }$ for all ${ n \geq N }.$ Now ${ d(f(x _n), f(y _n)) \lt \epsilon }$ for all ${ n \geq N },$ as needed.
${ \underline{ \textbf{Properties of} \text{ } \overline{f} } }$
From now, ${ A \overset{f}{\to} Y }$ is uniformly continuous and ${ Y }$ is complete, and ${ \overline{A} \overset{\overline{f}}{\to} Y }$ is as defined above.
Note ${ \overline{f} \vert _{A} = f }.$ We'll show ${ \overline{f} }$ is uniformly continuous.
Let ${ \epsilon \gt 0 },$ and ${ p, q \in \overline{A} }.$ We want a ${ \delta \gt 0 }$ independent of ${ p,q },$ such that ${ d(p,q) \lt \delta }$ implies ${ d(\overline{f}(p), \overline{f}(q) ) \lt \epsilon }.$
Pick ${ \eta \gt 0 }$ such that ${ x,y \in A, d(x,y) \lt \eta }$ implies ${ d(f(x), f(y)) \lt \frac{\epsilon}{10} }.$
We'll show ${ \delta := \frac{1}{10} \min\lbrace \epsilon, \eta \rbrace }$ will work.
Suppose ${ {\color{green}{d(p,q) \lt \delta}} }.$
Pick seqs ${ (x _n), (y _n) \subseteq A }$ with ${ d(x _n, p) \to 0 },$ ${ d(y _n, q) \to 0 }.$ Now ${ d(f(x _n), \overline{f}(p)) \to 0 }$ and ${ d(f(y _n), \overline{f}(q)) \to 0 }$ too.
So pick an ${ m }$ such that ${ {\color{green}{d(x _m, p)}} },$ ${ {\color{green}{d(y _m, q)}} },$ ${ {\color{green}{d(f(x _m), \overline{f}(p))}} }$ and ${ {\color{green}{d(f(y _m), \overline{f}(q))}} }$ are all ${ {\color{green}{\lt \delta}} }.$
Now ${ d(\overline{f}(p), \overline{f}(q)) }$ ${ \leq d(\overline{f}(p), f(x _m)) }$ ${ + d(f(x _m), f(y _m)) }$ ${ + d(f (y _m), \overline{f}(q)) }$ ${ \leq 2\delta + {\color{red}{d(f(x _m), f(y _m))}} . }$
But as ${ d(x _m, y _m) }$ ${ \leq d(x _m, p) }$ ${ + d(p,q) }$ ${ + d(q, y _m) }$ ${ \lt 3 \delta \lt \eta },$ we have ${ {\color{red}{d(f (x _m), f(y _m)) \lt \frac{\epsilon}{10}}} }.$ This gives ${ d(\overline{f}(p), \overline{f}(q)) }$ ${ \leq 2\delta + \frac{\epsilon}{10} }$ ${ \lt \epsilon }.$
Finally ${ d(\overline{f}(p), \overline{f}(q)) \lt \epsilon },$ as needed.
[This shows we could've set ${ \delta := \frac{1}{3} \min \lbrace \epsilon, \eta \rbrace }$ to begin with. But ${ \frac{1}{10} }$ was a "safer factor" to carry out the estimates]
[Uniqueness] Suppose ${ \overline{A} \overset{g}{\to} Y }$ is continuous and ${ g \vert _{A} = f }.$ We see ${ g = \overline{f} }$ :
Let ${ p \in \overline{A}. }$ Pick a seq ${ (x _n) \subseteq A }$ with ${ d(x _n, p) \to 0 }.$ As ${ g }$ is continuous, ${ g(p) = \lim _{n \to \infty} g(x _n) }.$ But ${ g(x _n) = f(x _n) }$ and ${ \overline{f}(p) = \lim _{n \to \infty} f(x _n). }$ So ${ \overline{f}(p) = g(p) },$ as needed.