I want to prove that two polynomial functions that are equal over a specific interval, $(a, b) \in \mathbb R$ (closed interval with more than one point if that condition is necessary) are equal over $\mathbb R$. I had an attempt that intuitively makes sense but I want to make the argument more formal.
These were my attempts:
I have tried expanding the general equation of a polynomial as a product of its roots but got stuck.
I then simplified the question. I examined the case of two linear functions equivalent at a point. I figured if it is equivalent at another point (not necessarily over an interval), it would be trivial to prove that the two functions are the same.
I moved to extend it to quadratic functions. I figured all we need is three points to pinpoint the expression of the polynomial. Given that the functions are equal over an interval, we have more than enough.
I figured that, intuitively, this should continue for any two polynomials of arbitrary degree. Therefore, if two polynomials of $n$-degree are equal over $n + 1$ points on the plane, then the two polynomials are the same. However, something feels very wishy-washy with this proof. How can I make this proof more formal and are there any alternate proofs?