How do I prove this using the definition of a derivative? If $f$ is a differentiable function and $g(x)=xf(x)$, use the definition of a derivative to show that $g'(x)=xf'(x)+f(x)$.

Just do it: set up the difference quotient and take the limit as $h\to 0$. I’ll get you started:
$$\begin{align*}
g'(x)&=\lim_{h\to 0}\frac{g(x+h)-g(x)}h\\
&=\lim_{h\to 0}\frac{(x+h)f(x+h)-xf(x)}h\\
&=\lim_{h\to 0}\frac{x\big(f(x+h)-f(x)\big)+hf(x+h)}h\\
&=\lim_{h\to 0}\frac{x\big(f(x+h)-f(x)\big)}h+\lim_{h\to 0}\frac{hf(x+h)}h\;.
\end{align*}$$
Now just finish working out what those last two limits are; it shouldn’t be hard, especially when you already know what they must be.
