Your proof has the right idea, but is not fully rigorous. The problem is that $[xF]_0^\infty=\lim_{x\to\infty} x\cdot F(x)-0\cdot F(0)=+\infty$, and $\int_0^\infty F(x)\,dx=+\infty$ as well, so your expression $[xF(x)]^\infty_0-\int_0^\infty F(x)\,dx$ is not well defined.
One way to fix this is to express the integral over $[0,\infty)$ as a limit of finite integrals.
$$
\int_0^\infty xf(x)\,dx
=\lim_{N\to\infty} [x F(x)]^N_0-\int_0^N F(x)\,dx
=\lim_{N\to\infty} \Big(N\cdot F(N)-\int_0^N F(x)\,dx\Big)
$$
Now, we cannot at this point split the limit of the difference into a difference of limits, because again you run into $\infty-\infty$. However, the following trick suffices to evaluate the limit:
$$
\begin{align}
&\phantom{=}\lim_{N\to\infty} \Big(N\cdot F(N)-\int_0^N F(x)\,dx\Big)
\\
&=\lim_{N\to\infty} N\cdot \big(F(N)-1\big)+\int_0^N (1-F(x))\,dx
\\
&= \int_0^\infty (1-F(x))\,dx+\lim_{N\to \infty} N\cdot (F(N)-1)
\end{align}
$$
Now, for this calculation to prove that $\int_0^\infty x\,f(x)\,dx=\int_0^\infty (1-F(x))\,dx$, it would need to be the case that $\lim_{N\to\infty}N\cdot (F(N)-1)=0$. Indeed, this is the case, but it is a little trick to prove. Here is an earlier answer where I prove this limit: Is it true that $\lim\limits_{x\to\infty}{x·P[X>x]}=0$?
An alternative way to fix this would be to realize that you can use any antiderivative for $f(x)$ when doing integration by parts, and that a better choice of antiderivative is $F(x)-1$. That is, letting $u=x$ and $v=F(x)-1$, you get
$$
\int xf(x)\,dx=[uv]^\infty_0-\int_0^\infty v\,du=[x(F(x)-1)]^\infty_0-\int_0^\infty (F(x)-1)\,dx=\int_0^\infty(1-F(x))\,dx.
$$