I'm having trouble with the first part of this question:
"Show that $f(x)=x$ and $g(x)=|x|$ are linearly independent as functions on all of $\mathbb R$, but linearly dependent when considered as functions defined only on $\mathbb R^+ = \{x > 0\}$."
I think I have answered the linear dependence part correctly.
for $x>0$, and $a,b$ scalars $\in \mathbb R$:
$af(x) + bg(x) = 0$. $ax + b|x| = 0$.
$ax + bx = 0$ [since $x$ is positive I can drop the absolute value signs].
$(a+b)*x = 0$ since $x>0$, either $a = -b$ or $b = -a$. We have a nontrivial solution and can therefore conclude linear dependence.
I'm just having trouble proving linear independence on all of $\mathbb R$. I'm also confused as to how we go from a linearly dependent subset (i.e. $f$ and $g$ with only positive real $x$ values), to a linearly independent set in all of $\mathbb R$.
Let $a,b\in\mathbb{R}$ and suppose that $af+bg=0$. Then, in particular, $af(1)+bg(1)=0$ and $af(-1)+bg(-1)=0$. In other words, $a+b=-a+b=0$. But then $a=b=0$. Therefore, $f$ and $g$ are linearly independent.