Why isn't the definition of absolute value applied when squaring a radical containing a variable? I recently learned about the following definition of absolute value:

$|a| = \sqrt{a^2}$

Then I came across a solution to a problem that had the following step:

$5 \geq \sqrt{5 - x}$

In order to proceed, we had to square both sides:

$5^2 \geq (\sqrt{5 - x})^2$

With the aforementioned definition of absolute value in mind, I wrote:

$25 \geq |5 - x|$

But the actual solution turned out to be:

$25 \geq 5 - x$

I don't understand why the absolute value definition wasn't applied here. Can anyone tell me why?

To compare $\sqrt{5-x}$ to $\sqrt{a^2}$ you must compare $5-x$ to $a^2$. The problem is that $a^2 \ge 0$ while $5-x$ can be any real number. But if you add the restriction $5-x \ge 0$, then $25 \geq |5 - x|$ becomes 
$$\text{$25 \geq 5 - x  \ \text{and} \ 5-x \ge 0$}$$
