Is there an $f$ that takes two values $a$ and $b$ and if $b>a$, it returns $f(a,b) = b-a$ otherwise $f(a,b) = 0$?
Is the $f$ linear?
P.S: I think one can find the maximum between $a$ and $b$ and then subtract $a$ from the maximum to get the desired $f$ described above.
The following is "almost" linear $$ \max\{a,b\}=\frac{a+b+|a-b|}{2} $$