Let $k$ be a field, let $c_1, \ldots, c_m \in k$ be distinct elements, and let $\lambda_1, \ldots, \lambda_m$ be nonzero elements of $k$. Prove that $$\frac{\lambda_1}{x - c_1} + \cdots + \frac{\lambda_m}{x - c_m} \neq 0.$$
ATTEMPT
Suppose that the sum is 0. Then multiplying both sides by the common denominator the product $(x - c_1) \cdots (x - c_m)$ yields $$\lambda_1[(x - c_2) \cdots (x - c_m)] + \cdots + \lambda_m[(x - c_1) \cdots (x - c_{m - 1})] = 0. $$ Since the $\lambda_i$ are nonzero, this implies that the set of $m$ polynomials $$\{(x - c_2) \cdots (x - c_m), \ldots, (x - c_1) \cdots (x - c_{m - 1})\}$$ are linearly dependent over $k$. This means that any basis for $k[x]$ has at most $m$ elements. But this is a contradiction because $k[x]$ has no finite basis (there are polynomials of arbitrarily high degree). Therefore the original sum is 0.
Your sentence « This means that any basis for $k[x]$ has at most $m$ elements. » is wrong. That would be true if those polynomials would span $k[x]$.
To get the desired result, replace $x$ by $c_i$ in the equality
$$\lambda_1[(x- c_2) \cdots (x- c_m)] + \cdots + \lambda_m[(x - c_1) \cdots (x - c_{m - 1})] = 0 $$ to get $\lambda_i =0$ as the $c_i$ are supposed to be distinct and $k$ a field, thus without zero divisors.
A contradiction as the $\lambda_i $ are supposed to be nonzero.