I am unable to prove an identity that looks very much like the Lagrange interpolation identity,
Problem: Given $f(x)$ is a monic, $n-1$ degree polynomial and $a_1, a_2, \cdots a_n$ distinct real numbers, prove
$$\displaystyle \sum_{i=1}^{n} \dfrac{f(a_i)}{\prod_{j \neq i}(a_j-a_i)}=1$$.
My attempt: Putting $x=0$, in the interpolation formula and assuming that $f(0) \neq 0$, we have,
$$\displaystyle \sum_{i=1}^{n} \dfrac{(-1)^nf(a_i)}{\prod_{j \neq i}(a_i)(a_j-a_i)}=1$$. But I don't know what to do next.
Also I made an observation that, if $g(x)=(x-a_1)(x-a_2)\cdots (x-a_n)$, then we need to show
$$\displaystyle \sum_{i=1}^{n} \frac{f(a_i)}{g'(a_i)}=(-1)^{n-1} $$
But I don't know what to do next, though the last identity looks interesting.
Please help me. I am in high school. This problem is taken from a handout by Yufei Zhao.