I am writing this because I want to fill the hole in my understanding of elementary functions in Euclidean plane. In class, we discussed parallel examples, such as $y = f(x)$ vs. $y = |f(x)|$. Plotting $f(x) = x^2 - 2$ and $f(x) = |x^2 - 2|$ gives:
I can intuitively understand the graph of $f(x) = |x^2 - 2|$; it is derived from the definition of absolute value:
$$|a| = \begin{cases} \hfill a & \text{if $x\geq 0$}\\ -a & \text{if $x<0$} \end{cases}.$$
Therefore all values produced by $y = |x^2 - 2|$ are positive. If $x^2 - 2$ is negative, then by definition we take its negative — therefore, all points that originally had negative values for $y$ coordinate are reflected over $x$ axis. I believe I understand these examples properly.
Now to the example I don't understand. In class we also discussed $y = f(x)$ vs. $y = f(|x|)$. I do not understand the logic behind such graphs! For example, let's plot $f(x) = -x^3 + 2$ and $f(x) = -|x^3| + 2$:
In class we observed that to get a graph of $f(|x|)$ one has to reflect the points of I. and IV. quadrants of the normal $f(x)$ over $y$ axis. My professor said this is apparent from the definition of the absolute value, but I still can't grasp how.
Please help me understand this observation we made (and if the observation is by any chance false, please help me understand why the graph is as it is altogether). Thank you in advance.


That's because$$f\bigl(|x|\bigr)=\begin{cases}f(x)&\text{ if }x\geqslant 0\\f(-x)&\text{ otherwise.}\end{cases}$$But this means that, in order to draw the graph of $f\bigl(|x|\bigr)$, with draw the graph of $f(x)$ for $x\geqslant0$ and then, to get the rest, you reflect this on th $y$-axis.