Proving $ 2xf(x)+g(x)^2 \leq M(1+\vert x \vert^2) $ Let $f,g \in C^1$ and assume there exists $k,K>0$ s.t. for all $x \in \mathbb{R}$
$$
k\leq\vert g(x)\vert \leq K(1+\vert x \vert).
$$
Assume furthermore that
$$
\limsup_{\vert x \vert \to \infty} \text{sgn}(x)\frac{f(x)}{g(x)^2} < 0.
$$
Then I want to prove there exists a constant $M>0$ s.t. for all $x \in \mathbb{R}$
$$
2xf(x)+g(x)^2 \leq M(1+\vert x \vert^2).
$$

My attempt: Let $x \in \mathbb{R}$. Using the first (upper) inequality, we get that
$$
g(x)^2 \leq (K(1+\vert x \vert))^2 = K^2(1+\vert x\vert^2+2\vert x\vert)
$$
which rearranged gives
$$
-2K^2\vert x \vert+g(x)^2 \leq K^2(1+\vert x\vert^2)
$$
which is a promising righthand side. Now we  need $f$ to appear on the left hand side and for this we need the second inequality. However this is something we know only for $\vert x \vert \rightarrow \infty$ so it need not apply for this $x$.
We know for sufficiently large positive values of $x$, we have $f$ is negative and for large negative values $f$ is positive. But how can we use this?
Should we somehow split into cases or what is the approach to finish the proof? I am stuck here. Also that $g$ is bounded away from 0 needs to play in somehow as well.
Any help is appreciated!
 A: I don't believe there is any need for case splitting. After working through the definition of $\limsup_{|x|\to\infty}$, the second condition roughly says there is some $c>0$ and some $n>0$ such that, for $|x|\geq n$,
$${\rm sgn}(x)\frac{f(x)}{g(x)^2}<-c.$$
We know that $g(x)^2\geq k^2>0$, and $|x|>0$, so multiplying both sides of the inequality by $g(x)^2|x|$ gives
$$xf(x)<-cg(x)^2|x|$$
where we have used that $|x|{\rm sgn}(x)=x$. Adding $g(x)^2$ to both sides, we have for $|x|\geq n$ that
$$xf(x)+g(x)^2<(1-c|x|)g(x)^2.$$
When $1-c|x|<0$ the desired inequality holds for any choice of $M$ since the LHS is negative. If $1-c|x|>0$, then $1-c|x|<1$ and we can use the inequality on $g(x)^2$ that you've already found. Indeed, we have
$$g(x)^2\leq K^2(1+|x|^2+2|x|)\leq M(1+|x|^2)$$
for suitable choice of $M$ since there is some constant $C$ for which $|x|\leq C(1+|x|^2)$.
Now there is one remaining caveat, which is that most of the above analysis relied on $|x|$ being sufficiently large. On the other hand, for $x\in [-n,n]$ the function $xf(x)+g(x)^2$ has a maximum $M_0$, and we can just replace $M$ with $M' = \max(M_0,M)$ in the above to get an inequality valid for all $x\in \mathbb{R}$.
