It seems like an extremely easy question, but I can't solve it. All I know is that it is a $\frac{1}{2^n}$ chance that all tosses will result in heads and $\sum_{k=0}^{n} f(k, n)$ is equal to 1 given the function.
Even though school has just started for me, this is not a homework question.
This probability is equal to $f(i, n) = \binom{n}{i}2^{-n}$, where $\binom{n}{i} = \frac{n!}{i! (n-i)!}$ is binomial coefficient. This is true because there are $\binom{n}{i}$ ways to choose which coins will be heads up and each such combinaton of $i$ heads up coins has the same probability $2^{-n}$.