We know that if we have two real differentiable functions $\;f,g\;$ on an interval $\;I\subset \Bbb R\;$ s.t. $\;h'(x)=g'(x)\;\;\forall\,x\in I\;$ , we then get that $\;f(x)=g(x)+C\;$ on $\;I\;$ , $\;C=$ a constant, and from here we get, under the same assumptions, that with a twice differentiable function $\;f\;$ on an interval $\;I\;$
$$(1)\;\;f''(x)=a=\text{ a constant}\;\implies\;\exists\,\text{constants}\;\;b,c\;\;s.t.\;\;f(x)=\frac a2x^2+bx+c\;\;(2)$$
The above is pretty simple, but my problem now is to find a counterexample as simple as possible to the last claim above if $\;I\;$ is not an interval , meaning: a function $\;f\;$ differentiable twice and fulfilling (1) does not necessarily have the form (2) if we don't assume $\;I\;$ is an interval .
By simple I mean that this is Calculus I and any argument about connectedness or the like must be avoided if possible.
Thanks (Yes, I know: "Don't thank anyone!", but my mom's education kicks in here...)