For example I have to solve this equation $$|x-1|+|2x+4|=5.$$ I have been taught that I have to make an table and find the cases in which $x-1$ and $2x+4$ are going to be positive and negative, both negative for the interval $(-\infty;-2)$; first negative and second positive for $(-2;1)$; and both positive for $(1;+\infty)$ in this case, and then solve for $x$ in each case and you get three results: $-8/3$ for $x \in (-\infty;-2)$, $0$ for $x \in (-2;1)$ and $2/3$ for $x \in (1;+\infty)$.
Here is what I don't understand. Why only $-8/3$ and $0$ are supposedly solutions and $2/3$ is not? I was told its because $x \notin (1;+\infty)$. But that doesn't really make sense for me, can anyone explain this in more detail?
To understand what the issue is, let consider this simpler example
and for $\color{magenta}{x\ge -1}$ we have
$$|x+1|+1=0 \iff x+2=0 \iff x=-2$$
but the possible solution obtained is out of the interval we have considered, that is $\color{magenta}{-2<-1}$ and indeed this value is not a solution for the original equation
$$|-2+1|+1=1+1=2\neq 0$$