Show $|x-1|$ and $|2x-1|$ are convex functions using the fact that a convex function $f:\mathbb{R} \rightarrow \mathbb{R}$ satisfies: for any $x^{(1)},x^{(2)}\in\mathbb{R}$ and $\lambda_1,\lambda_2 \geq0$, where $\lambda_1+\lambda_2=1$ we have $f(\lambda_1x^{(1)}+\lambda_2x^{(2)})\leq\lambda_1f(x^{(1)})+\lambda_2f(x^{(2)})$
I figured out how to solve this for $|x|$ but I am having a hard time applying the same ideas to $|ax-b|$.
For $f(x)=|x|$ I did:
$\begin{align} f(\lambda_1x^{(1)}+\lambda_2x^{(2)}) &= |\lambda_1x^{(1)}+\lambda_2x^{(2)}| \\&\leq |\lambda_1x^{(1)}|+|\lambda_2x^{(2)}| \\&= \lambda_1|x^{(1)}|+\lambda_2|x^{(2)}| \\&= \lambda_1f(x^{(1)})+\lambda_2f(x^{(2)}) \end{align}$