$f, g: \mathbb{R} \to \mathbb{R}$ and $f(x+h) = f(x) + g(x)h + a(x,h)$ for $|a(x,h)| \leq Ch^3$. Show that $f$ is affine. 
Let $f, g: \mathbb{R} \to \mathbb{R}$ be functions that obey $f(x+h) = f(x) + g(x)h + a(x,h)$ for $|a(x,h)| \leq Ch^3$ for all $x, h \in \mathbb{R}$ and for some constant $C$. Show that $f$ is affine (i.e., $f(x) = mx+b$ for some $m, b \in \mathbb{R}$).

It seems that I should use some knowledge from derivatives to solve it, but I totally have no clue how to start. Could anyone give me some hints?

I am really sorry that I made a typo and the relation should be $f(x+h) = f(x) + g(x)h + a(x,h)$ (which is fixed above).
 A: Enough to show $\forall r,f(r)=f(0)+rg(0)$.
First, let me simply the question a bit.
If there exist $f,g$ satisfying the condition and $f$ is nonaffine with $f(0)=a$ and $f(1)=a+b$, we may consider $f^*(x)=\frac{f(x)-a}{b},g^*(x)=\frac{g(x)}{b}$, where $f^*$ is not affine and $(f^*,g^*)$ also satisfies the condition. 
Furthermore, if there exist such $f,g$ s.t. $f(r)\neq 0$, we may consider $f^*:x\mapsto f(rx)$ and $g^*:x\mapsto g(rx)$ as counterexample to $f(1)=0$.
Thus, it suffices to show $f(1)=0$.

Consider positive integer $N$.
$|f(\frac{1}{N})-f(0)|=|f(\frac{1}{N})|=|a(0,\frac{1}{N})|\le \frac{C}{N^3}$
$\forall l,\forall k,f(\frac{k+l}{N})=\frac{k}{N}g(\frac{l}{N})+a(\frac{l}{N},\frac{k}{N})\Rightarrow |f(\frac{l+1}{N})+f(\frac{l-1}{N})-2f(\frac{l}{N})|\le \frac{2C}{N^3}$ 
$\Rightarrow\forall l\in\mathbb{Z}_{\ge 0},|f(\frac{l+1}{N})-f(\frac{l}{N})|\le C\cdot\frac{2l+1}{N^3}$
$\Rightarrow\forall l\in\mathbb{Z}_{\ge 0},|f(\frac{l}{N})|\le C\cdot\frac{l^2}{N^3}$
$\Rightarrow |f(1)|\le\frac{C}{N}$
Since this works for every $N$, $f(1)=0$ and so we are done.
A: Note that as $h \to 0$,
$$\frac{f(x+h)+f(x-h)-2f(x)}{h^2} = \frac{g(x)h+a(x,h)+g(x)(-h)+a(x,-h)}{h^2} \to 0,$$
that is, $f''(x) = \lim \frac{f(x+h)+f(x-h)-2f(x)}{h^2} = 0$ for all $x$. This already completes the proof.
