Let $Y$ be a random variable with characteristic function $\phi_Y:t\mapsto e^{-\sigma^2t^2}$, i.e. $Y$ is Gaussian (possibly degenerate).
The hypothesis in the problem states that $\phi_X$ and $\phi_Y$ coincide along a sequence $(x_n)$ of non-zero reals such that $x_n\to 0$. If $\phi_X$ were analytic in a neighborhood of $0$, so would be $\phi_X - \phi_Y$ and since the zeroes of an analytic function are isolated, this would imply $\phi_X - \phi_Y = 0$, as wanted.
Instead of showing directly that $\phi_X$ is analytic, we show that $X$ has moments of all orders. This will imply that $\phi_X$ is infinitely differentiable. We show next that $\forall n \geq 0$, $\phi_X^{(n)}(0)=\phi_Y^{(n)}(0)$. Since $Y$ is uniquely determined by its moments (see here or here), this will yield $\phi_X=\phi_Y$.
For $n\geq 1$, let $\displaystyle f_n:t\mapsto \frac{2-e^{ix_n t}-e^{-ix_n t}}{x_n^2}$ and note that it is real-valued, non-negative and by a Taylor expansion $\forall t\in \mathbb R, f_n(t) \to t^2.$ By Fatou's lemma,
$$\begin{align}
E(X^2)
&\leq \liminf_n E(f_n(X)) \\
&=\liminf_n \frac{2-\phi_X(x_n)-\phi_X(-x_n)}{x_n^2} \\
&=\liminf_n \frac{2-\phi_X(x_n)-\overline{\phi_X(x_n)}}{x_n^2} \\
&=\liminf_n \frac{2-\phi_Y(x_n)-\phi_Y(-x_n)}{x_n^2} \\
&= -\phi_Y''(0)
\end{align}
$$
where the last equality follows from a Taylor expansion of $\phi_Y$. Hence $X$ has a second moment, and by a classical result $\phi_X$ is twice-differentiable over $\mathbb R$.
Since $\phi_Y$ is even we may assume WLOG that all the $x_n$ are positive, and also that $(x_n)$ is strictly decreasing (by taking a subsequence if needed). By Rolle's theorem applied to $\phi_X-\phi_Y$, there is some sequence $(y_n)$, strictly decreasing, with $y_n\to 0$ and $\forall n\geq 1, \phi_X'(y_n) = \phi_Y'(y_n)$. Another application of Rolle's provides some sequence $(z_n)$, strictly decreasing, with $z_n\to 0$ and $\forall n\geq 1, \phi_X''(z_n) = \phi_Y''(z_n)$.
Defining a new $f_n$ and performing a similar reasoning, we prove successively that $E(X^4)<\infty$, $\phi_X^{(3)}$ and $\phi_Y^{(3)}$ coincide along a sequence that goes to $0$ and similarly for $\phi_X^{(4)}$ and $\phi_Y^{(4)}$. This continues indefinitely. $\phi_X$ is therefore $C^\infty$, each $\phi_X^{(m)}$ is continuous and taking limits along the aforementioned sequences we find that $\forall m\geq 1$, $\phi_X^{(m)}(0)=\phi_Y^{(m)}(0)$.
Note that the proof follows through if $Y$ is replaced by any random variable that is uniquely determined by its moments. For example, it is sufficient that $\limsup_n \frac{E(|Y|^n)^{1/n}}{n} <\infty$.