Let $N \geq 3$ and $R>0$. Check that Green function's for the Laplace equation in the sphere $\overline{B}_R=\{x\in \mathbb{R}^N : |x|\leq R\}$ is given by $$G(x,y)=\begin{cases} \frac{1}{(N-2)\omega_N}\left\{|x-y|^{2-N}-\left(\frac{|x|}{R}\right)^{2-N}\left|\frac{R^2x}{|x|^2}-y\right|^{2-N}\right\} & \text{if } x\neq 0 \\ \frac{1}{(N-2)\omega_N}\left\{|y|^{2-N}-R^{2-N}\right\} & \text{if } x= 0 \end{cases}$$ where $\omega_N=\int_{|\nu|=1}dw$.
To solve this question, a clue is given. It suggest to look for $G(x,y)$ as $$G(x,y)=\frac{|x-y|^{2-N}}{(N-2)\omega_N}-\frac{\kappa}{(N-2)\omega_N}|\lambda x-y|^{2-N},$$ where $\kappa$ and $\lambda$ are parameters to determine and $\lambda x\neq y$.
As it's a Green function, we know that is has to be zero in the boundary of the sphere. Then, $$|x-y|^2=\kappa^{\frac{2}{N-2}}|\lambda x-y|^2.$$ Then, $$|y|^2(1-\kappa^{\frac{2}{N-2}})=|x|^2(\kappa^{\frac{2}{N-2}}\lambda^2-1)-2\langle x,y \rangle (\lambda \kappa^{\frac{2}{N-2}}-1),$$ where I made $x^2=|x|^2$ and $y^2=|y|^2$. Now, taking in account that $|y|^2=R^2$, $$R^2(1-\kappa^{\frac{2}{N-2}})=|x|^2(\kappa^{\frac{2}{N-2}}\lambda^2-1)-2\langle x,y \rangle (\lambda \kappa^{\frac{2}{N-2}}-1),$$ But now I don't know how to continue. What's the relation between $\kappa$ and $\lambda$. I will appreciate any help.
I see now that my comments were somewhat misleading. Parameters $\kappa,\lambda$ are allowed to depend on $x$, but not on $y$; I prefer to introduce $\mu := \kappa^{\frac{2}{N-2}}$. They have to be chosen so that $G(x,y) = 0$ for $y \in \partial B(0,R)$, equivalently $$ |x-y|^2 = \mu |\lambda x-y|^2 \quad \text{for all $y$ such that } |y|^2=R^2. $$ Transforming it like you did, $$ 2\langle x,y \rangle (\lambda \mu-1) = |x|^2(\mu\lambda^2-1)-R^2(1-\mu). $$ If $x$ is fixed (and so are $\mu,\lambda$), then the RHS is constant for all $y \in \partial B(0,R)$. Thus the LHS also needs to be constant and we have to choose $\mu,\lambda$ so that $$ \tag{1} \lambda \mu - 1 = 0. $$ The resulting equation is $$ \tag{2} 0 = |x|^2(\mu\lambda^2-1) - R^2(1-\mu). $$ Solving (1), (2) for $\mu,\lambda$, we get $$ \begin{cases} \lambda = 1 \\ \mu = 1 \end{cases} \quad \text{or} \quad \begin{cases} \lambda = \frac{R^2}{|x|^2} \\ \mu = \frac{|x|^2}{R^2} \end{cases} $$ Both solutions guarantee that $G(x,y) = 0$ for $y \in \partial B(0,R)$, but the first one doesn't work (try to check it yourself). The second leads to the desired Green's function.