This question comes to me when I deal with the following PDE problem.
Suppose we have \begin{cases} -\Delta u=0 & x\in \mathbb R^N\setminus B(0,1)\\ u=0 & x\in\partial B(0,1)\\ u\to 0 & |x|\to\infty \end{cases} Then I am going to prove that $u\equiv 0$. This problem can be proven very quickly by using Maximum Principle.
But I got boring tonight and try to use energy method to prove this problem. I start with $$ 0=\int_{\mathbb R^N\setminus B(0,1)} \Delta u\, u\,dx = -\int_{\mathbb R^N\setminus B(0,1)} |\nabla u|^2\,dx+\int_{\partial B(0,1)} \nabla u\,u\,\nu d\sigma $$ and the last term is $0$ because of the boundary condition and we done.
Here I realize that I am using Gauss-Green theorem to do integration by parts on the unbounded domain and the integration over the boundary of $\mathbb R^N$ at "infinity" has been ignored by the condition $u\to 0$ as $|x|\to \infty$.
I remember I proved this result from my old classes... But now I can not justify it. I tried to do the following by taking
$$ 0=\int_{B(0,R)\setminus B(0,1)} \Delta u\, u\,dx = -\int_{B(0,R)\setminus B(0,1)} |\nabla u|^2\,dx+\int_{\partial B(0,1)} \nabla u\,u\,\nu d\sigma+\int_{\partial B(0,R)} \nabla u\,u\,\nu d\sigma $$ and I try to take $R\to \infty$.
But I don't see why $$ \lim_{R\to \infty} \int_{\partial B(0,R)} \nabla u\,u\,\nu d\sigma=0$$ even if $u$ vanish at infinity because we don't know the rate of vanishing and no information of $\nabla u$...
Update:
Based on @Jose27's answer, my question has been well-solved. But in addition, I have a interested question here for case $N=2$.
It looks to me that for $N=2$, we need $\lim_{|x|\to \infty} u(x)$ to be exists, and hence we have $u$ is actually bounded.
Moreover, from Folland PDE book, page 115, proposition 2.74 I read that the following statement is equivalent if $u$ is harmonic outside $B(0,1)$, for $N=2$:
(a): $|u(x)|=o(\log|x|)$ as $x\to \infty$
(b): $|u(x)|=O(1)$ as $x\to\infty$
Quickly we have $(b)\implies (a)$. For converse, we notice that if $u$ satisfies $(a)$, then we have $\bar{u}$ is bounded and in turn $u$ is bounded as well.