Functions agreeing on dense sets: weakest separation axiom Question
In a proof about continuous $\mathbb C$-Automorphisms, it was used that two continuous functions $\mathbb C \rightarrow \mathbb C$ agreeing on a dense subset must be equal. I was curious to figure out whether that holds for topological spaces in general.  I could prove the following
Lemma: Let $B$ be Hausdorff. If two continuous functions $f,g: A\rightarrow B$ agre on a dense subset $D\subset A$, they agree on the whole space $A$.
Proof. Assume there was a point $a\in A$ where they differed. By the Hausdorff axiom, we can find two disjoint open sets $F\ni f(a),G\ni g(a)$. Since the intersection of their preimages must be open and $D$ is dense, there must be a point $x \in f^{-1}(F)\cap g^{-1}(G)$ on which $f$ and $g$ agree, so $f(x)\in F$ and $f(x)=g(x)\in G$, contradicting the assumed disjointness.
Since the Hausdorff axiom is quite a strong restriction, I tried to look for counterexamples in general topological spaces and found this:
Example Consider the topological space $\mathcal T:=\left([0,2],\,\{\emptyset,[0,1),[0,2]\}\right)$ and
$$f:=id\vert_{\mathcal T},\quad
g:x\mapsto\begin{cases}x,& x\in [0,1)\\ 2,&\mathrm{else.}\end{cases}$$
We note that both functions are continuous, agree on the dense subset $\{1,2\}$, but are not equal.
Since this on the other hand is a very weak example ($\mathcal T$ is not even $T_0$), I was wondering:
What is the minimum separation axiom that must be fulfilled by $B$ in order for this to hold?
Edit: Answer
These are the conclusions I reached by clarifying parts of @user87690's answer.  Upon writing this, I noted that this very question has been asked here before, effectively rendering this a duplicate.
Recall the following 
Definition. A point $x$ is called isolated if $\{x\}$ is open.
We immediately observe the following 
Lemma. Let $B:=(X, \mathcal T)$ be a topological space, $x\in X$. $U\setminus\{x\}$ is dense in $B$ if and only if $x$ is isolated.
Theorem. Let $B:=(X, \mathcal T)$ be a non-Hausdorff space. There is a space $A$ and continuous functions $f, g$ agreeing on a dense subset of $A$ that are not equal.
Proof. Let $x, y\in X$ be non-separable points. One of them is non-isolated, WLOG $x$. We will define (as set-functions)
$$f := id\vert_X, \quad g: p\mapsto \cases{ y,\quad p=x\\ p,\quad else, }$$
in other words, $p$ differs from the identity by mapping $x$ to $y$.
Note that although the initial topology would make $f,g$ continuous, it is uninteresting in the sense that $U\setminus\{x\}$, the set on which both agree, is not dense (because $x$ is isolated).
Instead we will use the coarsest topology making $f$ an $g$ continuous, which is the topology generated by $\mathcal T \cup g^{-1} [\mathcal T]$.
As we will prove in the next lemmata, $x$ is not isolated in this topology, and so $X\setminus \{x\}$ is dense . $\tag*{$\blacksquare$}$
Lemma. Let $x\in X$. If two $\cap$-stable generators $\mathcal G, \mathcal G^\prime \subset \mathcal P (X)$ don't contain $\{x\}$, $x$ will not be isolated in $\langle \mathcal G\cup \mathcal G^\prime \rangle$ if and only if for every choice $A\in \mathcal G, B\in \mathcal G^\prime$, $A\cap B \neq \{x\}$.
Proof. By $U_c$ we mean the hull operator taking countable unions, and by $I_f$ we mean the hull operator taking finite intersections. If a set $\mathcal G$ is $\cap$-stable, by induction over set cardinality we have $I_f(\mathcal G) = \mathcal G$. The coarsest topology containing a generating set $\mathcal G$ can be constructed explicitly by applying both hull operators and adding $\{X, \emptyset\}$.
We now note that $U \in I_f(\mathcal G \cup \mathcal G^\prime)$ can be represented as
$$U =
\bigcap_{i=1\\G_i\in \mathcal G}^n G_i
 \cap \bigcap_{i=1\\G_i\in \mathcal G^\prime \setminus \mathcal G} G_i,$$
and due to $I_f$-Stability of both sets, we can choose
\begin{align}
A&:=\bigcap_{i=1\\G_i\in \mathcal G}^n G_i \in \mathcal G \\
B&:=\bigcap_{i=1\\G_i\in \mathcal G^\prime \setminus \mathcal G}^n G_i \in \mathcal G^\prime,
\end{align}
So $U = A \cap B$ where $A, B$ are either empty or in $\mathcal G, \mathcal G^\prime$, respectively.
This leaves us with
$$I_f(\mathcal G \cup \mathcal G^\prime)
= \mathcal G
\cup \mathcal G^\prime
\cup \{A\cap B\,\vert A\in \mathcal G, B\in\mathcal G^\prime \}.$$
We can now observe
\begin{align}
\{x\} &\in \langle \mathcal G\cup \mathcal G^\prime \rangle
  = \{X, \emptyset\} \cup U_c(I_f(\mathcal G \cup \mathcal G^\prime))\\
\Leftrightarrow \{x\} &\in U_c(I_f(\mathcal G \cup \mathcal G^\prime))\\
\Leftrightarrow \{x\} &\in I_f(\mathcal G \cup \mathcal G^\prime)\\
  &= \mathcal G
  \cup \mathcal G^\prime
  \cup \{A\cap B\,\vert A\in \mathcal G, B\in\mathcal G^\prime \}\\
\Leftrightarrow \exists A\in \mathcal G, B\in\mathcal G^\prime:\ \{x\}&= A\cap B\\
\end{align}
$\tag*{$\blacksquare$}$
We observe that 
\begin{align}
g^{-1}[\mathcal T]
&= \{U\setminus\{x\} \,\vert x\in U\not\ni y\}\\
&\cup \{U\cup\{x\} \,\vert x\not\in U\ni y\}\\
&\cup \{U \,\vert x\not\in U\not\ni y\}\\
&\cup \{U \,\vert x\in U\ni y\}\\
\end{align}
Where the last two sets are already contained in $\mathcal T$.
Therefore, our topology can be written as $\langle \mathcal T \cup \mathcal S \rangle$ where
$$\mathcal S := \mathcal S_1 \cup \mathcal S_2
:= \{U\setminus\{x\} \,\vert x\in U\not\ni y\}
\cup \{U\cup\{x\} \,\vert x\not\in U\in y\}$$
We can now observe (proof omitted, do a case distinction as done with $U$ above) that


*

*$\mathcal S$ is $\cap$-stable

*no intersection of $A\in \mathcal G$ and $B\in \mathcal G^\prime$ yields $\{x\}$


Both of which can be used to deduce that $x$ cannot be isolated in our topology, completing the above proof of our theorem.
$\tag*{$\blacksquare$}$
 A: Let us call a topological space $B$ good if for every topological space $A$ and two continuous maps $f, g\colon A \to B$ that agree on a dense set are equal, and let us call $B$ bad if it is not good.
You observed that every $T_2$ space is good and gave an example of a non-$T_0$ space that is bad. In fact, every non-$T_0$ space is bad, i.e. every good space is $T_0$. If $x ≠ y$ are to indistinguishable points, then consider $f$ and identity and $g$ being the modification of $f$ that maps $x$ to $y$. There are continuous maps and they agree on $B \setminus \{x\}$. Since $x$ is not isolated, we are done.
It seems to be a good idea to consider these one-point modifications of the identity. If $B$ is non-$T_2$, there are two points, $x ≠ y$ that cannot be separated by disjoint neighborhoods. One of them is non-isolated, wlog $x$. Let $A$ be $B$, $f$ the identity, and $g$ the same one-point modification of $f$. Now $g$ does not have to be continuous, but we may endow $A$ with the initial topology to fix this. If $x$ remains non-isolated in this new topology, then we have that $B$ is bad.
Let $U ⊆ B$ be open. If $x ∈ U ∌ y$, then $g^{-1}[U] = U \setminus \{x\}$. If $x ∉ U ∋ y$, then $g^{-1}[U] = U ∪ \{x\}$. Otherwise, $g^{-1}[U] = U$. Therefore, if $\{x\}$ becomes isolated in the finer topology, this is witnessed by $\{x\} = (U ∪ \{x\}) ∩ V$ where $x ∉ U ∋ y$ and $U, V$ are open in the original topology. We have $U ∩ V = ∅$, $x ∈ V$, and $y ∈ U$. This is a contradiction. Therefore, every non-$T_2$ space is bad, and so exactly $T_2$ spaces are good.
