Is the following set convex?
$$\{(x_1,x_2,x_3): x_3= |x_2|, x_1\leq 4\}$$
Is the following set convex?
$$\{(x_1,x_2,x_3): x_3= |x_2|, x_1\leq 4\}$$
Just writing the Hagen's example. Every point of the form
$$(0,1,1)\cdot k+(1-k)(0,-1,1)=(0,2k-1,1) \text{ for $k \in [0,1]$}$$
It should be in the set. But if you take $k=1/2$ then you will get the point $(0,0,1)$ which is not in the set and so it is not convex.
To say a set $S$ is convex means that if $u \in S$ and $v \in S$ then every point on the line segment joining $u$ and $v$ belongs to $S$.
Visually, it's clear that the line segment joining the points $u = (0,1,1)$ and $v = (0,-1,1)$ goes outside your set. To give an algebraic proof, just select a value of $\lambda$ such that $0 < \lambda < 1$ and $\lambda u + (1 - \lambda) v$ does not belong to your set. In this case, we can just pick $\lambda = 1/2$, so that $\lambda u + (1 - \lambda) v$ is the midpoint of $u$ and $v$. In other words: $$ \lambda u + (1 - \lambda) v = (0,0,1), $$ which is a point that does not belong to your set.