A basis for $k(X)$ regarded as a vector space over $k$

A $k$-basis is given by expressions of the form $$\frac{x^i}{[p(x)]^n}$$ where $p(x)$ is a monic irreducible polynomial with coefficients in $k$, $i$ and $n$ are nonnegative integers, and $i\lt\deg(p)$, together with the positive powers of $x$.

The fact that these elements span $k(x)$ follows from partial fraction decomposition.

To verify linear independence, first note that we cannot have $$p(x) = \frac{f(x)}{g(x)}$$ with $p$, $f$, and $g$ polynomials, $\gcd(f,g)=1$, and $g\notin k$ (this is just unique factorization in $k(x)$). Given a linear combination equal to $0$, equating the "polynomial part" and the "rational function part" shows they are both zero; the polynomial part being zero means all coefficients are equal to $0$. So you are reduced to verifying that the "rational function" part is independent. Then can rewrite this part as a sum of the form $$\frac{f_1(x)}{(p_1(x))^{n_1}} + \cdots + \frac{f_k(x)}{(p_k(x))^{n_k}}$$ where $p_1,\ldots,p_k$ are pairwise distinct monic irreducibles, and $\deg(f_i)\lt n_i\deg(p_i)$. Going to an algebra closure and evaluating the numerators you get at roots of the $p_i$ easily yield that $f_i(x)=0$ for all $i$. This reduces to the case of fractions in which the denominators are all powers of the same monic irreducible, which is straightforward.