Is there a function for every possible line? I'm currently in Pre-Calculus (High School), and I have a relatively simple question that crossed my mind earlier today. If I were to take a graph and draw a random line of any finite length, in which no two points along this line had the same $x$ coordinate, would there be some function that could represent this line? If so, is there a way we can prove this?

Yes. If the two end points of the line are $(x_1,y_1)$ and $(x_2,y_2)$ then the function is $f:[x_1,x_2]\to \mathbb R$ defined by $f(x)=\frac{y_2-y_1}{x_2-x_1}(x-x_1)+y_1$.
