Find a function $f$ analytic at $x_{0} = 0$ so that $f\left(\frac{1}{n}\right) = \frac{n}{n + 1}, n = 1, 2, \ldots$. I am learning about real analytic functions on my own right now. I've been 
 having trouble with one of the exercises, and it isn't much help that most of the resources online for analytic functions are for Complex Analysis. I am talking about real analytic functions. 
For reference, here is a definition that I have been using:

A real function $f(x)$ is analytic at $x_{0}$ if there is a $r > 0$:
$$f(x) = \sum_{n = 0}^{\infty} a_{n}(x - x_{0})^{n}, |x - x_{0}| < r$$
i.e. there is some power series which converges to the function.

Using this definition, I want to solve the following exercise problem:

Find a function $f$ analytic at $x_{0} = 0$ so that
  $f\left(\frac{1}{n}\right) = \frac{n}{n + 1}$, $n = 1, 2, \ldots$. 
Show that such a function cannot be analytic on $(-2, 0)$.

So, working backwards, I found out that $\frac{1}{1 + x}$ satisfies the property $f(\frac{1}{n}) = \frac{n}{n + 1}$. I'm really not so sure how to prove the analytic properties though. I think that now I need to show $\frac{1}{1 + x}$ is analytic, and then I need to prove the second part of the claim, which is that such a function cannot be analytic on $(-2, 0)$.
I have an example in my book which shows $1 + x + x^{2} + x^{3} + \cdots$ is analytic. Here's how they do it:
A prototypical example is the geometric series $$1 + x + x^{2} + \cdots = \lim_{n\to\infty} 1 + x + x^{2} + \ldots x^{n} = \lim_{n\to\infty}\frac{1 - x^{n + 1}}{1 - x}$$ 
for which it is well known equals $f(x) = \frac{1}{1 - x}$ for $|x| < 1$. To verify that the function is analytic, we need to expand about any point $x_{0} \neq 1$:
$$
\begin{align*}
\frac{1}{1-x} = \frac{1}{1 - x_{0} - (x - x_{0})} = \frac{1}{1- x_{0}}\left(1 - \frac{x - x_{0}}{1 - x_{0}}\right)^{-1}
\end{align*}
$$
I tried outlining this example, but I couldn't make any progress. I would really appreciate some sort of help.
 A: This is a solution without the Identity Theorem.  It is a bit lengthy, but I have no other tricks.  Combinatorial identities I use in my proof can be proven using the technique from here.
Note that $$f(x)=\dfrac{1}{1+x}\tag{*}$$ for all $x$ such that $\dfrac{1}{x}$ is a positive integer.  We also see that $$f(0)=\lim_{n\to\infty}\,f\left(\dfrac1n\right)=1\,.$$
This means (*) is true when $x=0$ too.
We can try to find $f^{(k)}(0)$ for $k=1,2,3,\ldots$ by noting that
$$f^{(k)}(0)=\lim_{h\to 0^+}\,\frac{1}{h^k}\,\sum_{r=0}^k\,\binom{k}{r}\,(-1)^r\,f\big((k-r)h\big)\,.$$
Taking $h:=\dfrac{1}{m\cdot k!}$ for some positive integer $m$, we have
$$f^{(k)}(0)=\lim_{m\to \infty}\,(m\cdot k!)^k\,\sum_{r=0}^k\,\binom{k}{r}\,(-1)^r\,f\left(\frac{k-r}{m\cdot k!}\right)\,.$$
Since $\dfrac{m\cdot k!}{k-r}$ is a positive integer for all $r=0,1,2,\ldots,k-1$, and $f(0)=1$, we get
$$f^{(k)}(0)=\lim_{m\to \infty}\,(m\cdot k!)^k\,\sum_{r=0}^k\,\binom{k}{r}\,(-1)^r\,\left(\frac{1}{1+\frac{k-r}{m\cdot k!}}\right)\,.$$
Because $\sum\limits_{r=0}^k\,\binom{k}{r}\,(-1)^r\,(k-r)^t=0$ for $t=0,1,2,\ldots,k-1$, we get
$$f^{(k)}(0)=\lim_{m\to \infty}\,(m\cdot k!)^k\,\sum_{r=0}^k\,\binom{k}{r}\,(-1)^r\,\left(\frac{1}{1+\frac{k-r}{m\cdot k!}}-\sum_{t=0}^{k-1}\,(-1)^t\,\left(\frac{k-r}{m\cdot k!}\right)^t\right)\,.$$
Using Taylor's Theorem, we have
$$\frac{1}{1+\frac{k-r}{m\cdot k!}}-\sum_{t=0}^{k-1}\,(-1)^t\,\left(\frac{k-r}{m\cdot k!}\right)^t=(-1)^k\,\left(\frac{k-r}{m\cdot k!}\right)^k+\mathcal{O}\left(\frac{1}{m^{k+1}}\right)\,.$$
That is, 
$$f^{(k)}(0)=\lim_{m\to\infty}\,\left((-1)^k\,(m\cdot k!)^k\,\sum_{r=0}^k\,\binom{k}{r}\,(-1)^r\,\left(\frac{k-r}{m\cdot k!}\right)^k+\mathcal{O}\left(\frac{1}{m}\right)\right)\,.$$
Ergo,
$$f^{(k)}(0)=(-1)^k\,\sum_{r=0}^k\,\binom{k}{r}\,(-1)^r\,\left(k-r\right)^k=(-1)^k\,k!\,.$$
Therefore,
$$f(x)=\sum_{k=0}^\infty\,\frac{f^{(k)}(0)}{k!}\,x^k=\sum_{k=0}^\infty\,(-1)^k\,x^k=\frac{1}{1+x}$$
for all $x\in (-1,+1)$ because the radius of convergence is $1$.  This proves the existence and the uniqueness of $f$.
To show that there is no analytic function with the given property that is defined on $(-2,0)$, you need to show that such a function $f$ cannot be defined at $-1$.  One way to do this is noting that $x=-1$ is a pole of $\dfrac{1}{1+x}$.  Therefore, $x=-1$ is a natural boundary of $f(x)$.
