Construction of a $C^1$ function, which is (locally) larger than a given continous function 
Let $u: \mathbb{R}^n \rightarrow \mathbb{R}$ be a continous function which is differentiable at the point $x_o \in \mathbb{R^n}$. Find a function $v \in C^1(\mathbb{R^n})$ such that $v(x_o)=u(x_o)$, $\nabla v(x_o)=\nabla u(x_o)$ and $g=u-v$ has a strict (local) maximum at $x_o$.

I am not aware of any extension theorems I could apply to this problem
Would appreciate any help/hints.
 A: Suppose for simplicity $n=1,x_0=0$ and $u(0)=0=u'(0).$
Let $f$ be a $C^1$ function such that $f=0,x\le 0,$ $f=1,1\le x<\infty,$ and $f$ is strictly increasing on $[0,1].$ Let $D=\sup_{\mathbb R}f'.$
Let $a_k= 2^{-k},k=1,2,\dots.$ Set $m_k = \max_{[-a_k,a_k]}|u|. $ Then by continuity of $u,$ $m_1\ge m_2\ge \dots \to 0.$ We can assume no $m_k=0.$
I'll first build $v$ to the right of $0;$ we can then define $v$ to be even. Let $I_k = [a_{k+1},a_k).$ Define $f_1 =m_1\chi_{I_1}.$ For $k>1,$ define
$$f_k(x) =m_k +(m_{k-1}-m_k)f\left(\frac{x-a_{k+1}}{a_k-a_{k+1}}\right)\chi_{I_k}(x).$$
The idea is that $\sum_{k=1}^{\infty}f_k$ is a nice $C^1$ function on $[0,\infty)$ that bounds $u$ from above. At this point I hope it's clear that the $f_k$ fit smoothly together so that the sum of them is $C^1$ on $(0,\infty).$
Note that for $x\in I_k,$
$$\tag 1 f_k'(x) = (m_{k-1}-m_k)f'\left(\frac{x-a_{k+1}}{a_k-a_{k+1}}\right)\cdot \frac{1}{a_k-a_{k+1}}  \le m_{k-1}D2^{k+1}.$$
Now $m_{k-1}=u(c_{k-1})$ for some $c_{k-1}\in [-a_{k-1},a_{k-1}].$ Thus the right side of $(1)$ equals
$$|u(c_{k-1})|D2^{k+1} = \left|\frac{u(c_{k-1})}{c_{k-1}}\right|D|c_{k-1}|2^{k+1}$$ $$\le \left|\frac{u(c_{k-1})}{c_{k-1}}\right|D|c_{k-1}|2^{k+1} \le \left|\frac{u(c_{k-1})}{c_{k-1}}\right|D\cdot 4.$$
As $x\to 0^+$ the last expression above $\to 0.$ That's because $u'(0)=0.$ This imples $g=\sum_{k=1}^{\infty}f_k$ belongs to $C^1[0,\infty)$ as desired.
To finish, define $g$ on all of $\mathbb R$ by making it even. Finally, let
$$v(x) = x^2 + g(x).$$
Then $v>u$ in a deleted nighborhood of $0$ and $v(0)=0=v'(0).$ We are done in the case we started with. The higher dimensional case should follow easily from this.
