Analytic Functions Coinciding on a Subset of Open Interval Problem:
Let $f$ and $g$ be analytic functions at the open interval I. Suppose there is a set  $X \subset I$ and $X$ has an accumulation point $a \in I$
Now let's consider $f(x)=g(x) \enspace \forall x\in X$.
Show that $f(x)=g(x) \enspace \forall x\in I$

My reasoning:
I know I can use the fact that if there is $b \in I$ such that $f^{(n)}(b)=g^{(n)}(b) \enspace \forall n \in \mathbb{N}$, then $f(x)=g(x) \enspace \forall x\in I$. (where I am denoting $^{(n)}$ as the n-th derivative)
I could then take a sequence of points ${x_n} \in X$ such that ${x_n}$ converges to the accumulation point $a$ and show using induction that $f^{(n)}(x_n)=g^{(n)}(x_n) \enspace \forall n \in \mathbb{N}$, then take the limit of $x_n \to a$ 
But I have 2 problems:


*

*I do not know how to prove that "if there is $b \in I$ such that $f^{(n)}(b)=g^{(n)}(b) \enspace \forall n \in \mathbb{N}$, then $f(x)=g(x) \enspace \forall x\in I$."

*It seems to me there might be a simpler way


Also, I've seen this post that is related but could not understand the answer
 A: Hint: Consider $f(x) - g(x)$ and show that no analytic function can have an accumulation of roots unless it's the zero function.
A: It clearly suffices to consider the special case $g = 0$ (otherwise consider the analytic functions $F = f - g$ and $G = g - g = 0$).
Thus we have $f(x) = 0$ for all $x \in X$.
If $a \in I$ denotes any accumulation point of $X$, let us first show that $f^{(n)}(a) = 0$ for all $n \ge 0$.
Since $a$ is an accumulation point, we can construct a sequence $(x_k)_{k \in \mathbb N}$ in $X \setminus \{a\}$ such that $\lvert x_{k+1} - a \rvert < \min(1/n, \lvert x_k - a \rvert)$ for all $k \in \mathbb N$. Then clearly $\lim_{k \to \infty}x_k = a$. At least one of the sets $\{k \in \mathbb N \mid x_k > a \}$ or $\{k \in \mathbb N \mid x_k < a \}$ must be infinite. W.l.o.g. let us assume the first set is infinite. Hence $(x_k)$ contains a strictly decreasing subsequence. W.l.o.g. we can assume that $(x_k)$ itself is strictly decreasing.
We construct inductively sequences $s^n = (\xi_k^n)_{k \in \mathbb N}$, $n =0,1,2,3,\dots$ of points in $I$ such that


*

*For each $n$, the sequence $(\xi_k^n)$ is strictly decreasing and $\lim_{k\to\infty}\xi_k^n = a$.

*$f^{(n)}(\xi_k^n) = 0$ for all $n, k$.
Since the $f^{(n)}$ are continuous, this shows that $f^{(n)}(a) = \lim_{k\to\infty}f^{(n)}(\xi_k^n) = 0$.
For $n = 0$ we take $\xi_k^0 = x_k$. Now assume that we have constructed the sequences $s^0,\dots,s^n$. To construct $s^{n+1}$, we proceed as follows.
We know that $f^{(n)}(\xi_k^n) = f^{(n)}(\xi_{k+1}^n) = 0$. By Rolle's theorem we find $\xi_k^{n+1} \in (\xi_{k+1}^n,\xi_k^n)$ such that $f^{(n+1)}(\xi_k^{n+1}) = 0$. Then $(\xi_k^{n+1})$ is the desired sequence.
Let us now show that $f  = 0$.
Since $f$ is analytic, it can be developped into a Taylor series in an open interval $(a-\varepsilon, a+\varepsilon) \subset I$. This Taylor series has all coefficients $= 0$, thus $f(x) = 0$ for $x \in (a-\varepsilon, a+\varepsilon)$. Let $\mathfrak J$ denote the set of all open subintervals $J \subset I$ such that $a \in J$ and $f(x) = 0$ for $x \in J$. Then $J^* = \bigcup_{J \in \mathfrak J} J$ is a member of $\mathfrak J$, and in fact it is the maximal open subinterval of $I$ containing $a$ on which $f$ vanishes. Assume $J^* \subsetneqq I$. Then $J^*$ must have an accumulation point $b \in I \setminus J^*$ (which is a boundary point of the interval $J^*$). Arguing as above, we see that $f^{(n)}(b) = 0$ for all $n \ge 0$. Hence $f(x) = 0$ for $x \in (b-\delta,b+\delta) \subset I$. This is a contradiction because then $J' = J^* \cup (b-\delta,b+\delta)$ would be a member of $\mathfrak J$ which properly contains  $J^*$.
