How to calculate the range of $f(x) = x^2 - 2 | x |$? So if I do this :
$$
\left|x\right|^2 - 2 \left|x \right|+1-1 = \left( \left|x\right|-1 \right) ^2-1
$$
I get the range to be $[-1,\infty)$ and I also get this answer from GeoGebra. But I don't think this as the correct process.
Because for $f(x) = x^2 + 2 |x|$ without any calculation I can tell that its range is $[0,\infty)$. But by the previous process, I get,
$f(x)=(|x|+1)^2 - 1$ so the range is also $[-1,\infty)$ which is not true.
So how can I calculate the range of this function?
 A: Since $f(-x)=f(x)$ it is enough to find $f([0,\infty))$. On the interval $[0,\infty)$ the function decreases up to $x=1$ and then it increases. Hence the minimum  value is $f(1)=-1$. The maximum is $\infty$ because $f(x) \to \infty$ as $ x \to \infty$. Hence the range is $[-1,\infty)$. [ For a continuous function the range is an interval].
A: You say that "the range of $(|x|+1)^2-1$ is also $[-1,\infty)$". This is where you are wrong: the minimum value of this expression is $0$ (when $x=0$).
On the plot, the two functions under scrutiny.

A: You observed that 
$$f(x) = x^2 + 2|x| = x^2 + 2|x| + 1 - 1 = (|x| + 1)^2 - 1$$
then claimed falsely that this implies that the range of the function is $[-1, \infty)$.  This would be true if $|x| + 1$ could equal zero.  However, $|x| \geq 0$ for each $x \in \mathbb{R}$.  Therefore, as Anurag A observed in the comments, $|x| + 1 \geq 1$, with equality achieved at $x = 0$.  Hence, 
$$f(x) = x^2 + 2|x| = (|x| + 1)^2 - 1 \geq 1^2 - 1 = 1 - 1 = 0$$
as you observed by inspecting the original function.
Range of $\boldsymbol{f(x) = x^2 - 2|x|}$
Observe that the function $f(x) = x^2 - 2|x|$ is symmetric with respect to the $y$-axis since 
$$f(-x) = (-x)^2 - 2|-x| = x^2 - 2|x| = f(x)$$
Therefore, to determine its range, it suffices to determine its range on the domain $[ 0, \infty)$ since it will have the same range on $(-\infty, 0]$. 
As you observed,
$$f(x) = x^2 - 2|x| = x^2 - 2|x| + 1 - 1 = (|x| - 1)^2 - 1$$
If $x \geq 0$, $|x| = x$, so we obtain 
$$f(x) = (x - 1)^2 - 1$$
which is the equation of a parabola with vertex $(1, -1)$ that opens upwards.  As $x \to \infty$, $f(x) \to \infty$.  Since $f$ is continuous, every value greater than or equal to $-1$ is obtained by the Intermediate Value Theorem. Hence, the range of the function is $[-1, \infty)$, as you found.

Range of $\boldsymbol{f(x) = x^2 + 2|x|}$
Similarly, the function $f(x) = x^2 + 2|x|$ is symmetric with respect to the $y$-axis since 
$$f(-x) = (-x)^2 + 2|-x| = x^2 + 2|x| = f(x)$$
Thus, as in the previous example, to determine its range, it suffices to determine its range on the domain $[ 0, \infty)$ since it will have the same range on $(-\infty, 0]$. 
If $x \geq 0$ then 
$$f(x) = x^2 + 2|x| = (|x| + 1)^2 - 1 = (x + 1)^2 - 1$$
which is a parabola with vertex $(-1, -1)$ that opens upwards.  However, we require that $x \geq 0$.  Since the function is increasing to the right of its vertex, the function achieves its minimum value at $x = 0$.  That value is $f(0) = 0$.  Since the function is continuous and $f(x) \to \infty$ as $x \to \infty$, it achieves every nonnegative value as $x$ increases by the Intermediate Value Theorem.  Hence, its range is $[0, \infty)$.

A: The OP's function can be expessed this way:
$f(x) = \left\{\begin{array}{lr}
        x^2-2x\, \;\;\;\text{ |} & \text{for } x \ge 0\\
        x^2+2x \;\;\; \text{ |} & \text{for } x \lt 0
        \end{array}\right\}$
Using the quadratic formula you can show that
$\tag 1 [\exists x \ge 0 \; \land \; x^2 - 2x = r] \text{ iff } r \ge -1$
Using the quadratic formula you can show that
$\tag 2[ \exists x \lt 0 \; \land \; x^2 + 2x = r] \text{ iff } r \ge -1$
