Let f(x) be a function on R^n. Prove that f is convex and concave if and only if

f(x) = c.x + d

for some constant vector c in R^n and a scalar d in R.

The if part of the proof is straightforward, but I can't figure out to show the only if portion. Any help is very much appreciated!