If I take a piecewise linear function (piecewise affine) is it true that I can always write it as a sum of concave and convex functions?
My understanding of this page
https://mjo.osborne.economics.utoronto.ca/index.php/tutorial/index/1/cv1/t
suggests that any linear function is both convex and concave, so for a piecewise linear function is it always possible to 'separate' the convex and concave parts?
Let me assume that you are talking about a real-valued function $f : [a,b] \to \mathbb{R}$. A characterization of which such functions may be written as $f=g-h$ with $g$ and $h$ convex (so $-h$ concave) is known. The result is the following (see this book):
Here, "derivative" is in the sense that there exists a function $r \in BV[a,b]$ such that, for all $x \in [a,b]$, $$ f(x)-f(a) = \int_a^x r $$
Hence, the answer to your question is both yes and no. If you take an $f$ which is piecewise affine but has discontinuities, then you will not be able to find such a decomposition. Conversely, if it is continuous, then its derivative will be piecewise constant, so of bounded variation, so the above result applies.