A function is convex and concave, it is called affine function. That is the function: $$f(tx+(1-t)y)=tf(x)+(1-t)f(y),\, \, t\in (0,1) $$
Force $y=0$(suppose $0$ is in the domain of $f(x)$), we obtain:
$$f(tx)-f(0)=tf(x)-tf(0)=t[f(x)-f(0)]$$
So
$$F(x):=f(x)-f(0)$$ is linear, but we have a constraint here: $t\in(0,1)$.
How can we expand this to arbitrary $t$, and assert it is really linear?
Thanks.
You're almost done. The convex/concave property only speaks about $t\in[0,1]$, but the $x$ there is arbitrary, so you can just let that grow.
For example, $y=0, x=1$ shows that the function coincides with an affine* function on $[0,1]$. Then $y=0, x=1000$ shows that the function coincides with an affine* function on $[0,1000]$, which must be the same as before, or the values on $[0,1]$ wouldn't match up. In particular $f(1000)$ must be the value of the expression for the function that works at $[0,1]$, so this expression happens to work everywhere.
For negative numbers, similar reasoning works -- the function is affine* on $[-1000,1]$ and therefore must be the one you can extrapolate from $[0,1]$.
(* Whoops, for me "affine" means "of the form $x\mapsto ax+b$". I've kept that usage in my answer because I have no better short word to use for it).