Denote $\mathbb{Z}_{>0}=\{1,2,3, \ldots\}$ the set of all positive integers. Determine all functions $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ such that, for each positive integer $n$,
i) $\sum_{k=1}^{n} f(k)$ is a perfect square, and
ii) $f(n)$ divides $n^{3}$.
Induct on $n$ to show that $f(n)=n^{3}$ for all positive integers $n$. It is readily checked that this $f$ satisfies the conditions in the statement. The base case, $n=1$, is clear.

Let $n \geqslant 2$ and assume that $f(m)=m^{3}$ for all positive integers $m<n$. Then $\sum_{k=1}^{n-1} f(k)=\frac{n^{2}(n-1)^{2}}{4}$, and reference to the first condition in the statement yields
$f(n)=\sum_{k=1}^{n} f(k)-\sum_{k=1}^{n-1} f(k)=\left(\frac{n(n-1)}{2}+k\right)^{2}-\frac{n^{2}(n-1)^{2}}{4}=k\left(n^{2}-n+k\right)$,
for some positive integer $k$.
The divisibility condition in the statement implies $k\left(n^{2}-n+k\right) \leqslant n^{3}$, which is equivalent to $(n-k)\left(n^{2}+k\right) \geqslant 0$, showing that $k \leqslant n$.

On the other hand, $n^{2}-n+k$ must also divide $n^{3}$. But, if $k<n$, then

$$
n<\frac{n^{3}}{n^{2}-1} \leqslant \frac{n^{3}}{n^{2}-n+k} \leqslant \frac{n^{3}}{n^{2}-n+1}<\frac{n^{3}+1}{n^{2}-n+1}=n+1
$$

therefore $\frac{n^{3}}{n^{2}-n+k}$ cannot be an integer.
Consequently, $k=n$, so $f(n)=n^{3}$. This completes induction and concludes the proof.