Constructive proof for continuous function property I want to see a "constructive" proof of this statement:
Let $f,g \colon M \to M$ continuous function on a metric space $(M,d)$ such that $f(a)\neq g(a)$ in some point $a \in M$. Prove that exists a open set $A$ such that $f(A)\cap g(A) = \emptyset$.
Any help will be appreciated

My solution:
By contradiction we assume that for every open set $A$ : $f(A)\cap g(A) \neq\emptyset$. Then we can take $A_n = B(a,1/n)$ (the open ball) and we will have that $f(A_n)\cap g(A_n) \neq \emptyset$. This mean that $\exists x_n,y_n \in A_n$ such that $f(x_n) = g(y_n)$. Since $x_n,y_n \to a$ and $f,g$ are continuous then $f(a) = g(a)$ which is a contradiction.
 A: Let $l := d(f(a), g(a))$; then by continuity assumption there are $\delta_{1},\delta_{2} > 0$ such that
$f(B^{a}(\delta_{1})) \subset B^{f(a)}(\frac{l}{3})$ and $g(B^{a}(\delta_{2})) \subset B^{g(a)}(\frac{l}{3})$, where $B^{x}(y)$ is the ball of center $x$ and radius $y$; take $A := B^{a}(\delta_{1}) \cap B^{a}(\delta_{2})$.
A: $B_h (p)$ denotes the open ball of radius $h$ centered at $p$.
Let $\varepsilon = d(f(a), g(a) )$
As $f$ and $g$ are continuous, $\exists \delta_1, \delta_2 >0$ s.t. $$ f(B_{\delta_1}(a) ) \subset B_{\varepsilon /4} ( f(a) )$$  $$ g(B_{\delta_2}(a) ) \subset B_{\varepsilon /4} ( g(a) )$$
Let $\delta = \min (\delta_1, \delta_2 )$
The set $B_\delta(a)$ suffices.
A: It's easier to do it directly. Because $f(a) \neq g(a)$, there's are disjoint open neighborhoods $N_{f(a)}$ and $N_{g(a)}$ of $f(a), g(a)$ respectively: if $d = |f(a) - g(a)|$, take each to be an open ball of radius $d/2$ centered at the respective points. Because $f, g$ are continuous, there's a neighborhood $U_f$ of $a$ such that $f[U_f] \subseteq N_{f(a)}$, and similarly there's a neighborhood $U_g$ of $a$ such that $f[U_g] \subseteq N_{g(a)}$. Let $A = U_f \cap U_g$. Then $A$ has the desired property.
A: Evidently $d(f(a),g(a))>0$. 
Now find $\delta>0$ such that $d(a,x)<\delta$ implies that $$d(f(a),f(x))<\frac13d(f(a),g(a))\text{ and }d(g(a),g(x))<\frac13d(f(a),g(a))$$
Such $\delta>0$ exists because $f$ and $g$ are both continuous at $a$.
Then open ball $B(a,\delta)$ does the job.
This because the general inequality  $$d(f(a),g(a))\leq d(f(a),f(x))+d(f(x),g(y))+d(g(y),g(a))$$ implies that $$d(f(x),g(y))\geq\frac13d(f(a),g(a))>0\text{ if }x,y\in B(a,\delta)$$
Consequently $f(x)\neq g(y)$.
