Functions that can be written as a power series are called analytic functions.
Given a function $f:\mathbb{R}\to\mathbb{R}$, one can ask, when can we write
$$
f(x)=\sum_{n=0}^{\infty} a_nx^n,\quad |x|<R
$$
for some $R>0$.
In a mathematical statement, we do not "prove" assumptions, which are given. Though it is natural to ask when such assumptions can be indeed satisfied. (A statement that has assumptions that can never be true is boring. For example, "if $1>2$, then $5>9$" is a true statement. But one does not "prove" that the assumption "$1>2$" is true.)
A necessary condition for having the power series above is that $f$ must be infinitely differentiable on $(-R,R)$. But this is not sufficient, as the classical example of bump functions show: https://en.wikipedia.org/wiki/Bump_function.
You seem to confuse yourself with what the statement is.
Suppose $f:(-R,R)\to\mathbb{R}$ can be written as
$$
f(x)=\sum_{n=0}^\infty a_nx^n, |x|<R
$$
Then, it is true that
$$
f(x)=\sum_{n=0}^\infty \frac{f^{(n)}(0)}{n!}x^n, |x|<R
$$
In order to prove this assertion, one does NOT prove that $$
f(x)=\sum_{n=0}^\infty a_nx^n, |x|<R
$$
is true. One uses it as a given assumption.
Proof. By the assumption, $f$ is infinitely differentiable on $(-R,R)$. On the other hand, it is a property of the power series that one can differentiate term by term, namely,
$$
f'(x)=\sum_{n=1}^\infty a_n nx^{n-1},\quad |x|<R
$$
which implies that $f'(0)=a_1$. Similarly, one can show that
$$
f^{(n)}(0)=a_n n!
$$
Newly added.
As for when a given $C^\infty$ function can be written as a power series, one has the following theorem (see Stewart's Calculus).
Suppose $f:\mathbb{R}\to\mathbb{R}$ is an infinitely differentiable function. Let $a$ be a real number. Define $a_n=\frac{f^{(n)}(a)}{n!}$ for each $n$ with the convention that $f^{(0)}(a):=f(a)$ and $0!=1$. If for each $x$ with $|x-a|<R$,
$$
\lim_{n\to\infty} f(x)-T_n(x)=0
$$
where $T_n(x):=\sum_{k=0}^n a_n(x-a)^n$,
then
$$
f(x)=\sum_{n=0}^\infty a_n(x-a)^n,\quad |x-a|<R.
$$
This theorem is not so interesting in that it is simply unwrapping the definition of an infinite series.
You may also want to look at this post: Theorems that give sufficient condition for a $C^{\infty}$ function to be analytic