All triples are $a>0$ and $b^2=4ac$, or $a=b=c=0$.
Let $g(t)=at^2+bt+c$. Then:
1) $g(t)\geq0$ holds for all $t\in\mathbb{R}$. Otherwise if $g(t_0)<0$ for some $t_0$, we get $|f(x+t_0)-f(x)|\leq g(t_0)<0$, which is impossible)
2) $\min g(t)=0$. Otherwise if $\min g(t)=m>0$, take $f(x)=\begin{cases}{m,}&{x=0,}\\{0,}&{x\neq0.}\end{cases}$ We get $|f(x)-f(y)|\leq m\leq g(x-y)$.
From 1)2) we know that $a>0$ and $b^2=4ac$, or $a=b=c=0$.
It remains to prove that $f$ has to be constant under this condition.
The $a=0$ case is trivial. Now let $a>0$ and we know
$$|f(x)-f(y)|\leq a(x-y-r)^2$$for some $r\in\mathbb{R}$. If $r\neq 0$, let $x=y+r$ and then we know that $f$ is periodic with period $r$.
Hence
$$|f(x)-f(y)|=|f(x+r)-f(y)|\leq a(x+r-y-r)^2=a(x-y)^2.$$So we only need to consider the case $r=0$. This time we have
$$\left|\dfrac{f(x)-f(y)}{x-y}\right|\leq a|x-y|.$$By taking the limit $y\rightarrow x$, we know that $f'(x)=0$ for all $x\in\mathbb{R}$, which means that $f$ is constant.