Let $\Omega:=B(0,1) \subset \mathbb{R}^{N}.$
(i) Consider the function $u(x):=1 /\|x\|^{a}, x \neq 0,$ where $a>0$
Let $a+1<N$ and $1 \leq p<\infty$ and show that $u \in W^{1, p}(\Omega)$ if and only if $(a+1) p<N$ (in particular, $u \notin W^{1, p}(\Omega)$ for all $p \geq N)$.
(ii)Let $\left\{x_{n}: n \in \mathbb{N}\right\} \subset \Omega$ be a countable dense set and define $$u(x):=\sum_{n=1}^{\infty} \frac{1}{2^{n}} \frac{1}{\left\|x-x_{n}\right\|^{a}}, \quad x \in \Omega \backslash \bigcup_{n=1}^{\infty}\left\{x_{n}\right\}.$$
where $0<a<N-1.$ Prove that $u \in W^{1, p}(\Omega)$ if and only if $(a+1) p<N,$ but $u$ is unbounded in each open subset of $\Omega$.
For (i),I have proved $\|\nabla u\|=C/\|x\|^{a+1},$but I don't know what to do next.
For (ii),I have no idea about it...
Can someone give me a detailed hint?Thanks in advance.