Two functions $f$ and $g$ are said to be equal if their domains, codomains and graphs are all equal. A function $f:ℝ\toℝ$ is defined by Two functions $f$ and $g$ are said to be equal (written $f=g$) if their domains, codomains and graphs are all equal. A function $f:ℝ\toℝ$ is defined by
\begin{equation*}
f(x) = \left\{
        \begin{array}{ll}
            x^2 & \quad x \geq 0 \\
            x & \quad x < 0
        \end{array}
    \right.
\end{equation*}
a) Sketch the graph of the function $g$ given by $g(x)=f(|x|)$
So the function $g$ is like this?
\begin{equation*}
g(x) = \left\{
        \begin{array}{ll}
            (|x|)^2 & \quad x \geq 0 \\
            |x| & \quad x < 0
        \end{array}
    \right.
\end{equation*}
And the I just graph the right half of the parabola for the first piece and the left half of the V of absolute value function?
b) Let $h:ℝ\toℝ$ be given by $h(x)=x^2$, $x\inℝ$ let $g$ be as defined in part (b). Determine, using the definition of equality whether or not $h=g$. Justify your answer.
In this part I don't know if the part that says "let $g$ be as defined in part (b)" is a mistake and must say part (a) because in part (b) what is defined is $h$ not $g$.
Not sure on how to approach this part to be honest.
Thanks in advance for the help.
 A: You are wrong about function $g$. You have, for each $x\in\Bbb R$,\begin{align}g(x)&=f\bigl(|x|\bigr)\\&=\left\{\begin{array}{l}|x|^2&\text{ if }|x|\geqslant0\\|x|&\text{ if }|x|<0\end{array}\right.\\&=x^2\end{align}since $|x|^2=x^2$ and you never have $|x|<0$.
So, $g=h$ (and yes, that's a typo in the statement of part b)).
A: For the first part, see the comment below. However to make this notion of "equality" of functions more precise you need to ask yourself what is meant by "graph". And even though most people probably think of it as a picture we draw in a coordinate system, the graph of a function $f$ is defined as follows:
$$G(f) = \left\{\left(x,f(x)\right) : x \in D(f)\right\},$$
with $D(f)$ being the domain of $f$.
Now if you color in every point $(x,f(x))$ you get what you would usually call the graph, however this gets kind of tricky as soon as $D(f)$ is not one dimensional. Now for the second part (and that probably does mean "as defined in (a)"), you need to check for the equality of the two functions. Domain and codomain should be easy enough, so whats left is the graph. The equality you need to show is:
$$G(h) = \left\{\left(x,h(x)\right) : x \in D(h)\right\} = \left\{\left(x,g(x)\right) : x \in D(g)\right\} = G(g).$$
Which boils down to showing
$$\left(x,h(x)\right) = \left(x,g(x)\right) \Leftrightarrow h(x) = g(x), \; \forall x \in D,$$
$D$ being the common domain of $g$ and $h$. And as you can see this is a very natural way of checking "the equality of functions" since you just need to check that they take the same value and each input.
