Use the fact that $\text{id}:S^n\to S^n$ is not homotopic to a constant to show that there is no retraction of $B^{n+1}$ onto $S^n$.
I tried to look up online but most of the solutions use the concept of fundamentally group, which we never mentioned.
No knowledge about the fundamental group is necessary to solve this problem, although it leads to more "algebraic" (and even shorter) proof of the non-existence of such a retraction (at least for $n=1$). But the essential idea is the same.
Here is a hint: The inclusion map $i:S^n\hookrightarrow B^{n+1}$ is null-homotopic, i.e. there is a homotopy $H$ from $i$ to a constant map, for example $H(x,t)=tx$. If there were a retraction $r:B^{n+1}\to S^n$, what would that mean for the composite $rH:S^n\times I\to S^n$ ?