I need help with a proof regarding the absolute value. I have the definition: $$ \lvert x \rvert= \begin{cases} x, \quad &\text{if } x\geq0\\ -x, \quad &\text{if } x<0 \end{cases} $$
I want to prove that $-\lvert x\rvert\leq x$ is true for all real $x$.
Proof:
If $x\geq0$: Then $\lvert x \rvert=x$ so $-x\leq x$ or equivalent $x\geq 0$. Multiplication with $-1$ gives $-x\leq 0$. The two inequalities $x\geq 0$ and $-x\leq 0$ is the same as $-x\leq x$.
If $x<0$: Then $\lvert x \rvert =-x$ so $-(-x)<x$ is the same as $x<x$. But subtraction of $x$ on both sides gives $0<0$. Isn't $x<0$ valid? What is wrong here?
Update
I think the problem in the second case was the strict inequality. So maybe the proof should be:
If $x<0$: Then $\lvert x \rvert =-x$ so $-(-x)\leq x$ is the same as $x\leq x$, which is $x=x$.
Your own correction is right. Although $\lvert x \rvert= -x$ for $x\lt0$ it doesn't change the inequality from $\le$ to $\lt$. But you still made a minor mistake in the first part.
Proof:
If $x \ge 0$: $ \ -|x| \le x \iff -x \le x \iff 0 \le 2x $ which holds true since $ x \ge 0$.
If $x \lt 0$: $ \ -|x| \le x \iff -(-x) \le x \iff x \le x $ which holds true for all $x$.
Instead of proofing your statement for all $x \in \mathbb{R} $ at once, you split it up in $x \ge 0$ and $x \lt 0$. This enables you to replace $|x|$ with the definition each time. But each time you proof the same statement, so you don't change the actual statement (e.g. $\le$ to $\lt$).
In regard to solving inequalities you go about it like a normal equality. There are some additional rules which you have to follow with inequalities, but they don't apply to your example here. I encourage you to read this article on mathsisfun which explains them very well.