Is linear function convex or concave?

Solution 1:

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?

Solution 2:

Linear function is both convex and concave. You may be interested in this page.