I want to establish this statement: If $a<b$ and $\{x_0,x_1, \cdots x_n\} \subset \mathbb{R}$ distinct, then there is one and only one set of weights $\{w_0, \cdots w_n \} $ such that $\int_a^b f(x) \ = \ \sum_{0 \leq k \leq n} w_k f(x_k)$ for any polynomial of degree $n$.
The weights aren't dependent of $f$, are they? We have to use $a,b$ and maybe $n$ to find the weights. First I rewrote the right hand side of the equality. $$ \sum_{k=0}^n f(x_k) \ = \ \sum_{j=0}^n a_j \sum_{k=0}^nw_k x_k^j $$ we can rewrite the other side as $ \sum_{j=0}^n a_j(b^j-a^j) $. The equality must hold for polynomials of the shape $x^j$ for $0 \leq j \leq n$. Hence we can deduce the system: $$ \forall j \in \{0, \cdots, n\}, \quad w_0x_0^j + w_1x_1^j + \cdots + w_n x_n^j \ = \ b^j-a^j $$ The equation can be shown with a matrix $$ \left(\begin{array}{ccc|c} 1 & \cdots & 1 & 0\\ x_0 & \cdots & x_n & b-a \\ & \vdots & & \vdots\\ x_0^n & \cdots & x_n^n & b^n-a^n \end{array}\right)$$ Can you tell me if this is the right way to deal with this problem, and how I can see that the vectors $$ \{ \left( \begin{array}{c} 1 \\ x_k \\ \vdots \\ x_k^n \end{array} \right) \quad : \quad 0 \leq k \leq n\} $$
Your approach is sound. What remains to do to complete it is to note that the matrix $$\left(\begin{array}{ccc} 1 & \cdots & 1 \\ x_0 & \cdots & x_n \\ & \vdots & \\ x_0^n & \cdots & x_n^n \end{array}\right)$$ is called a Vandermonde matrix and that its determinant is known to be $$\prod_{0\leqslant k\lt\ell\leqslant n}(x_\ell-x_k).$$ In particular, if the numbers $x_k$ are all distinct, the matrix is invertible and you are done.