Question: Suppose $L$ be a Vector Space of Polynomials of $x$ of degree $\leq n-1$ with coefficients in the field $\mathbb{K}$.

Define $$g\_i(x) :=\prod \_ {{j=1},{j\neq i}}^n \frac{x-a\_j}{a\_i-a\_j}$$ Show that the polynomials $g\_1(x), g\_2(x),...,g\_n(x)$ form a basis of L. Furthermore, show that coordinates of polynomial $f$ in this basis are $\{f(a\_1),f(a\_2),...,f(a\_n)\}.$

To show that the polynomials are the bases, I need to show that they span $L$ and that they are linearly independent. I thought showing that any element in the set $\{1,x,x^2,...,x^{n-1}\}$ belongs to the span of $\{g\_1(x), g\_2(x),...,g\_n(x)\}$ would be enough to show the $g\_1(x), g\_2(x),...,g\_n(x)$ spans $L.$ But I don't know how to do this! Also, linear independence seems to be tougher!

Answer: 
Here is very easy method to show that they are linearly independent.

Suppose that $$b\_1g\_1(x)+b\_2g\_2(x)+...+b\_ng\_n(x)=0$$
To show linear independence, it suffices to show that $$b\_1=b\_2=...=b\_n=0$$
Evaluate 
$$b\_1g\_1(x)+b\_2g\_2(x)+...+b\_ng\_n(x)=0$$
at $$x=a\_i\;\;\;\;\forall i\le n$$

You can notice that $$g\_i(a\_j)=\begin{cases}0&i\neq j \\ 1 & i=j\end{cases}$$

It follows that $$b\_1=b\_2=b\_3=...=b\_n=0$$

To see that the coordinates are given as such, consider a general polynomial as above
$$f(x)=c\_1g\_1(x)+c\_2g\_2(x)+...+c\_ng\_n(x)=0$$

Follow same thing as above, start substituting $x=a\_i$, you will see that 
$$c\_1=f(a\_1)$$ and so on.

Best of luck.
I hope I could help.
You missed the hypothesis that the $a\_i$ are pairwise distinct. Alternatively, consider the functionals $\eta\_i$ with $P\mapsto P(a\_i)$ in $V=(\Bbb R\_{n-1}[X])^\ast$, and suppose $$\sum\_{i=1}^n\lambda\_i\eta\_i=0$$

Evaluating at $1,X,X^2,\ldots,X^{n-1}$ we get $n$ equations $k=0,1,2,\ldots,n$. 

$$\sum\_{i=1}^n\lambda\_ia\_i^k=0$$

Or $$\begin{pmatrix}1&1&\cdots&1\\a\_1&a\_2& \cdots&a\_n\\\vdots&\vdots &\ddots&\vdots\\a\_1^{n-1}&a\_2^{n-1}&\cdots&a\_n^{n-1}\end{pmatrix}\begin{pmatrix}\lambda\_1\\ \lambda\_2\\\vdots\\ \lambda\_n\end{pmatrix}=\begin{pmatrix}0\\ 0\\\vdots\\ 0\end{pmatrix} $$

But since the $a\_i$ are pairwise distinct, the Vandermonde matrix is invertible, which means ${\bf \lambda} =\bf 0$ as desired.

The claim follows from the fact your polynomials are precisely the predual basis, call it $B$, of the evaluations above which form a basis $B'$ for $V$. This observation also means that $$(f)\_B=(\eta\_1f,\ldots,\eta\_n f)=(f(a\_1),\ldots,f(a\_n))$$

This is a general property: if $B^\*=\{\varphi\_1,\ldots,\varphi\_n\}$ is the dual basis of $B=\{v\_1,\ldots,v\_n\}$, and if $v\in V$, $\varphi\in V^\ast$, then $$(v)\_B=(\varphi\_1(v),\ldots,\varphi\_n(v))$$ $$(\varphi)\_{B^\ast}=(\varphi(v\_1),\ldots,\varphi(v\_n))$$ and the proof is just like that exhibited in the accepted answer: evaluate, and use $\varphi\_i(v\_j)=\delta\_{ij}$.