Can I view the Taylor polynomial as a generalization of the derivative? We know that we can regard a derivative as the "best linear approximation" of a function $f: (a,b) \to \mathbb{R}$ at a given point $x_0 \in (a,b)$. I was wondering whether we can view the Taylor polynomial as "the best polynomial approximation".
Another person has already asked a quite similar question, but I am not very satisfied with the answer because the norm that was defined in the first answer seems a bit arbitrary. I would suggest to define a Taylor polynomial in the following way:

Let $f:(a,b) \to \mathbb{R}$ be a real-valued function. A $k$-th order polynomial $p_k$ is a Taylor polynomial of order $k$ of $f$ at $x_0 \in (a,b)$, if there exists a function $r_k: (a,b) \to \mathbb{R}$ such that $$ f(x) = p_k (x) + r_k (x) \quad \text{ with } \quad \lim\limits_{x \to x_0} \frac{r_k(x)}{(x-x_0)^k} = 0.$$

I already know that if  $f$ is $k$ times differentiable at $x_0$, then this definition coincides with the usual one. My question is: Is it necessary for $f$ to be differentiable $k$ times at $x_0$? If not, does it have major implications on things like uniqueness, etc?
 A: First you'd want to ask your function to be continuous at $x_0$ since otherwise you could get trivial counterexamples. But even asking for continuity at $x_0$ you can get into trouble.
Define $f$ from $[-1, 1]$ to $\mathbb{R}$ as follows. If $x \in \mathbb{Q},$ simply set $f(x) = x.$
If $x \in [-1, -1/2] \cup [1/2, 1],$ and $x$ is irrational, then define $f(x) = x/2.$
If $x$ is irrational and $x \in [-1/2, -1/3] \cup [1/3, 1/2],$ then define $f(x) = 2x/3.$
Continue on in this way, so that if $x$ is irrational and $x \in [-1/n, -1/(n+1)] \cup [1/(n+1), 1/n],$ then $f(x) = nx/(n+1).$
Now set $g(x) = f(x)\cdot x.$
We claim that $g$ is differentiable at 0 but nowhere else. It is clearly differentiable at 0, with derivative 0, since $f(x)$ is continuous at $0$ (just write out the difference quotient to see why the implication holds; it is easy to see that $f$ is continuous at $0$). It is not differentiable anywhere else, though, since at any point $x_0 \neq 0,$ you can see that it looks locally like $x^2$ on the rational numbers, and so should have derivative $2x_0,$ but looks locally something like $nx^2/(n+1)$ on some irrational numbers, and so should have derivative $2nx_0/(n+1)$. These two only coincide if $x_0 = 0,$ and so you can't be differentiable at $x_0 \neq 0.$
Now we argue that $g$ has a second order Taylor polynomial at 0, namely $x^2.$
The idea is that in $[-1/n, 1/n],$ then either $g(x) - x^2$ equals $x^2 - x^2 = 0$ if $x\in\mathbb{Q},$ or else
$$\frac{n}{n+1}x^2 \leq g(x) \leq x^2,$$
so that $g(x) - x^2$ is bounded by $x^2/(n+1),$ so that $(g(x)-x^2)/x^2$ is bounded above by $1/(n+1)$ in $[-1/n, 1/n].$ It's clear now that the limit $\lim_{x\rightarrow 0} \frac{g(x)-x^2}{x^2} = 0.$
