Let $p>1$ be a natural number and $(a_i)_{i\geq 1}$ a sequence of element of the interval $\{0,1\ldots,p-1\}$. Clearly $0\leq\sup_{n}\sum_{i=1}^na_ip^{-i}\leq 1$.
Let $\sup_{n}\sum_{i=1}^na_ip^{-i}=1$. I need to show that $a_i=p-1$ for all $i$. Suppose there exists $k\geq 1$ such that $a_k<p-1$. This implies that for all $n$ and for all $r\leq s$ such $r,s\in\{0,\ldots n-1\}$ $$\sum_{i=r}^sa_ip^{-i}<\frac{1}{p^{r-1}}-\frac{1}{p^s}.$$ I am not sure how I can use the above to find a contradiction. How can I proceed?
You need to show that $$1 \,>\, \sum_{i=1}^{\infty}\frac{a_i}{p^i},$$ assuming that $a_k < p -1.$
The demonstration can be begun like this:
$$1 \,=\, \sum_{i=1}^{\infty}\frac{p-1}{p^i}\,>\,\sum_{i=1}^{k-1}\frac{p-1}{p^i}+\frac{a_k}{p^k}+\sum_{i=k+1}^{\infty}\frac{p-1}{p^i}.$$
Appendix.
$\sum_{i=1}^{\infty}\frac{p-1}{p^i}$ is a convergent series of positive terms; it converges to $1$. But given any series known to converge to a (finite) sum, we can always decompose it into two pieces, a finite beginning and an infinite tail. In other words, we apply the theorem