<s>[INST] Absolute value definition Is it true that $\dots$
$$
\left| y \right| = 
\begin{cases}
   y \hspace{1cm} y \geq 0 \\ -y \hspace{0.7cm} y < 0
\end{cases}
$$
I'm a little bit confused with the second case, where $|y| = -y$ then $y<0$, 
for example :
$$
\left| 2x-4 \right|=-(2x-4)
$$
if we assume that $ y=2x-4 $ then 
$$
\begin{align*}
y&<0 \\
2x-4&<0 \\
2x&<4 \\
x&<2
\end{align*}
$$
in the other way, we can solve it like this
$$
\begin{align*}
|y| \geq 0 \\
|2x-4| \geq 0 \\
-(2x-4) \geq 0 \\
2x-4 \leq 0 \\
x \leq 2
\end{align*}
$$
why is it giving the different answers?
 [/INST] It is a bit confusing to use the same letter $x$ for your substitution.
Let set $y=2x-4$.
Then $|y|$ is $\begin{cases}+y&=2x-4&\quad\text{when}\quad y\ge0\iff 2x-4\ge 0\iff x\ge 2\\-y&=4-2x&\quad\text{when}\quad y<0\iff 2x-4<0\iff x<2\end{cases}$

Indeed for $x=1$ then $x<2$ then $|y|=|2\times 1-4|=|-2|=2=4-2\times 1$
And for $x=3$ then $x\ge 2$ then $|y|=|2\times 3-4|=|2|=2=2\times 3-4$
</s>