TITLE: Is linear function convex or concave?
QUESTION [22 upvotes]: I was wondering if linear function is convex or concave? For example f(x)=x, is function whose second derivate is 0 so we cant tell anything using this criteria. Can someone help?

REPLY [28 votes]: A linear function is both. Use this definition of convexity:
For any two points $x_1$ and $x_2$
$$\forall a \in [0,1] \quad f(ax_1 + (1-a)x_2) \leq af(x_1) + (1-a)f(x_2)$$
Flip inequality for concave. Do you see why linear is both?

REPLY [11 votes]: Linear function is both convex and concave. You may be interested in this page.