Applying Taylor theorem on a linear map I found the following in a stack of practice problems but had trouble dealing with it:

Consider a linear map $A:C^\infty(\mathbb{R}^n)\rightarrow \mathbb{R}$ such that:
If $f\in C^\infty(\mathbb{R}^n)$ with $f(0)=0$ and $f(x)\geq 0$ in a neighborhood of $0$ then $A(f)\geq 0$. 
Show that there exists $a_{ij},b_i,c\in\mathbb{R}$ such that:
  $$
A(f)=\sum_{i,j=1}^n a_{ij}f_{x_ix_j}(0)+\sum_{i=1}^n b_i f_{x_i}(0)+cf(0)
$$

How someone can approach such questions? Any hints? 
 A: I will only do the case $n = 1$ since the general case is similar. Note that it is enough to show that $f(0) = f'(0)=f''(0) = 0$ implies $A(f) = 0$. To see this, suppose $A(1) =c, A(x) = b, A(x^2) = a$. Then for any $g$, $h(x):= g(x)- g(0) - g'(0)x-\frac{1}{2}g''(0)x^2$ satisfies $h(0) = h'(0)=h''(0)=0$. Then by assumption $A(h) = 0$ and hence $A(g) =  A(g(0)+ g'(0)x+\frac{1}{2}g''(0)x^2) = ag''(0) + bg'(0)+\frac{1}{2}cg(0)$ as desired. 
Now we show $f(0) = f'(0)=f''(0) = 0$ implies $A(f) = 0$. The Taylor series with remainder (which holds for all smooth functions), implies that $f(x) = ax^3+ g(x)x^4$ for some smooth $g$ in some small neighborhood of $0$ (a might be zero if $f'''(0) = 0$). Note that $f_\epsilon(x) = f(x) + \epsilon x^2 = ax^3 + g(x)x^4 + \epsilon x^2 = x^2(ax+ g(x)x^2+ \epsilon) \ge 0$ for a sufficiently small neighborhood around $0$ depending on $\epsilon$ since $\lim_{x\rightarrow 0} ax+ g(x)x^2 = 0$.  Also, $f_\epsilon(0)=0$. Hence $A(f_\epsilon) \ge 0$ and this holds for all $\epsilon$. Since $A$ is linear, we have $A(f) + \epsilon A(x^2) \ge 0$ and since this holds for all $\epsilon$, we get $A(f) \ge 0$. Similarly $g_\epsilon(x) = -f(x) + \epsilon x^2$ has $g_\epsilon \ge 0$ for a sufficiently small neighborhood (depending on $\epsilon$) and $g_\epsilon(0)= 0$ and so as before we get $A(-f) \ge 0$ and so $A(f) \le 0$. Therefore $A(f) = 0$ as desired. 
A: I assume that $f_{x_i},f_{x_ix_j}$ are  partial derivatives of $f$.
I don't know if the required result holds for $C^{\infty}(\mathbb{R}^n)$; yet, I think that it holds for $An(0)$, the set of real functions of $n$ real variables, defined in a neighborhood of $0$ and analytic in  $0$, that is, $f\in An(0)$ IFF there is $\epsilon >0$ s.t. if $||x||=\max_i|x_i|<\epsilon$ then $f(x)=\sum_{k_1,\cdots,k_n}a_{k_1,\cdots,k_n}x_1^{k_1}\cdots x_n^{k_n}$, where for every $0<r<\epsilon$, $\sum_{k_1,\cdots,k_n}|a_{k_1,\cdots,k_n}|r^{k_1+\cdots+k_n}<\infty$. I consider a norm on $An(0)$ and I assume that $f$ is a continuous linear function; in fact, I only need to write $A(f)=\sum_{k_1,\cdots,k_n}a_{k_1,\cdots,k_n}A(x_1^{k_1}\cdots x_n^{k_n})$.
Part 1. We show that $A(x_1^{k_1}\cdots x_n^{k_n})=A(p)=0$ when $k_1+\cdots+k_n\geq 3$. It suffices to consider (cf. the user39598 post) $p+\epsilon \sum_i x_i^2$ and $-p+\epsilon \sum_i x_i^2$. Then $A(f)=\sum_{k_1+\cdots+k_n\leq 2}a_{k_1,\cdots,k_n}A(x_1^{k_1}\cdots x_n^{k_n})=\sum_{i,j} a_{ij}f_{x_ix_j}(0)+\sum_{i} b_i f_{x_i}(0)+cf(0)$.
Part 2. We show that  there is $X$ symmetric $\geq 0$ and real numbers $(b_i)_i,c$
(without any condition) s.t. $A(f)=tr(XHess(f))+\sum_i
b_if_{x_i}(0)+cf(0))$.
One has $A(f(x)-\sum_i
f_{x_i}(0) x_i-f(0))=\sum_{ij}a_{ij}f_{x_ix_j}(0)$ or
$A(g(x))=\sum_{ij}a_{ij}g_{x_ix_j}(0)$ where $g=f+$ (affine function).
Note that $g(x)=f(x)-\sum_i f_{x_i}(0)
x_i-f(0)=1/2.x^THess(g)x+O(||x||^3)$ where $Hess(g)=[f_{x_ix_j}(0)]$.
Then $Hess(g)>0$ implies that locally $g\geq 0$ that implies
$\sum_{ij}a_{ij}f_{x_ix_j}(0)\geq 0$.
Assume that $Hess(g)\geq 0$; then we consider $h$, the homogeneous
function of degree $2$ s.t. $Hess(h)=Hess(g)$. Then globally $h\geq 0$
and $\sum_{ij}a_{ij}f_{x_ix_j}(0)\geq 0$. Finally, for every $f$,
$[f_{x_ix_j}(0)]\geq 0$ implies $\sum_{ij}a_{ij}f_{x_ix_j}(0)\geq 0$.
Since the matrices $B=[f_{x_ix_j}(0)]$ are symmetric, we may assume
that the matrix $X=[a_{ij}]$ is symmetric (else change $X$ with
$1/2(X+X^T)$).
Then, we must choose a symmetric $X=[a_{ij}]$ s.t. $B\geq 0$ implies
$tr(XB)\geq 0$. It is equivalent to $X\geq 0$ (we may assume that $X$
is diagonal and we deduce easily that its eigenvalues are $\geq 0$).
And we are done.
EDIT. About Part 1., the user39598 proof for $C^{\infty}(\mathbb{R})$ is correct. We can treat the case $n>1$, in the same way, by putting $f(x)=1/6.f'''(0)(x,x,x)+(\sum_i x_i^2)^2g(x)$ where $g\in C^{\infty}(\mathbb{R}^n)$ and considering $\pm f(x)+\epsilon \sum_ix_i^2$.
