Question:
Show that $f(n) = \sum_{i=1}^n i^2 = O(n^3)$
Logically speaking, since the upper limit of $i$ is $n$ and the equation is $i^2$, it can never surpass $n^3$ if $c = 1$ and $n > 1$, therefore $i^2 \le cn^3$.
I just don't know how to prove it mathematically.
Your intuition is pretty good but your conclusion is off. If you are summing $i$ from $1$ to $n$, you know that $i \le n$, meaning that
$$\sum_{i=1}^n i^2 \le \sum_{i=1}^n n^2 = n^3.$$
Can you take it from here?