Let $f,g:\mathbb R\to \mathbb R$ be functions such that $$f(x+h)=f(x)+g(x)h+\alpha(x,h)$$ for all $x,h\in \mathbb R$, where $|\alpha(x,h)|\le Ch^3$. Show that $f(x)=ax+b$ for some $a,b\in \mathbb R$.
I think the way I'm supposed to prove this is by showing that $f'(x)$ is identically constant. The derivative of $f$ at $x$ is $\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$. I can write the given condition as $$\left|\frac{f(x+h)-f(x)}{h}\right|\le |g(x)| + Ch^2,$$and as $h\to 0$, we get $|f'(x)|\le |g(x)|$.
Am I on the right track? Any further hints?
I think the OP meant to say $$\big|\alpha(x,h)\big|\leq C|h|^3\tag{*}$$ for all $x\in\mathbb{R}$ and $h\in\mathbb{R}$. Even if only $h\geq0$ is assumed in the OP's problem, it is not difficult to show that (*) still holds (but the constant $C$ in the OP's setting may need to be changed to a larger constant so that (*) is valid).
Let $x$ and $h$ be arbitrary real numbers. Note that $f(x+2h)-f(x)=2h\,g(x)+\alpha(x,2h)$ and $$\begin{align}f(x+2h)-f(x) &=\big(f(x+2h)-f(x+h)\big)+\big(f(x+h)-f(x)\big) \\&=\big(h\,g(x+h)+\alpha(x+h,h)\big)+\big(h\,g(x)+\alpha(x,h)\big)\,.\end{align}$$ This proves that $$g(x+h)-g(x)=\frac{\alpha(x,2h)-\alpha(x+h,h)-\alpha(x,h)}{h}\,.$$ From (*) and the Triangle Inequality, we obtain $$\left|\frac{g(x+h)-g(x)}{h}\right|=\left|\frac{\alpha(x,2h)-\alpha(x+h,h)-\alpha(x,h)}{h^2}\right|\leq \frac{10C|h|^3}{h^2}=10C|h|\,.$$ This proves that $g'$ exists and is identically zero (by taking $h\to 0$). That is, for some $a\in\mathbb{R}$, we have $g\equiv a$. As $f'=g$ (see other answers), we conclude that, for some $a,b\in\mathbb{R}$, $f(x)=ax+b$ for every $x\in\mathbb{R}$.
In general, I think this holds. Let $f,g_1,g_2,\ldots,g_k:\mathbb{R}\to\mathbb{R}$ and $\alpha:\mathbb{R}\times\mathbb{R}\to\mathbb{R}$ be such that, for every $x,h\in\mathbb{R}$, we have $$f(x+h)=f(x)+g_1(x)\,h+g_2(x)\,h^2+\ldots+g_k(x)\,h^k+\alpha(x,h)\,,$$ where $\big|\alpha(x,h)\big|\leq C|h|^{k+2}$ for any $x,h\in\mathbb{R}$. Then, $f$ is a polynomial function of degree at most $k$. Furthermore, $$g_m(x)=\frac{1}{m!}\,f^{(m)}(x)$$ for each $m=1,2,\ldots,k$. In particular, if $f(x)=a_0+a_1x+a_2x^2+\ldots+a_kx^k$, then $a_0=f(0)$ and $a_m=g_m(0)$ for each $m=1,2,\ldots,k$.