Suppose we have the following piecewise linear function $f(x)$:
$3x + 8, x\in [0,5]$
$33 - 2x, x\in [5,10]$
$3 + x, x\in [10,20]$
How to model the relations between $f(x)$ and $x$ using integer variables and linear constraints. How to specify the values of M if we model it using big-M method.