It is an exercise in my algebraic geometry course to prove Bezout's theorem in a particular restricted case. That is, prove the following: Given a field $K$ with $f,g \in K[X,Y]$, and deg $g =1$, prove that if $f$ and $g$ have no common factors, then the number of points in $K^2$ where $f(x,y)=g(x,y)=0$ is at most deg $f \cdot$deg $g$ = deg$f$.
Since we may assume $g$ has degree one, its solution set is a line in $K^2$. Suppose now deg $f = d$. My thinking was that if we can factor $f$ into say $d$ linear irreducible polynomials in $K[X,Y]$, then we are done: since each irreducible factor is linear, and none of them can be equal to $g$, there are at most $d$ lines intersecting $g$, and hence there are at most $d$ points of intersection with $g$.
However, I am struggling to see what happens if we cannot decompose $f$ into linear factors; for example it decomposes into less than $d$ irredcuible factors. In this case, I cannot say that the irredcubiles solution set is a line, so the previous argument doesn't work. Can I get a hint on how to proceed?
My concern with a factorisation of $f$ into non-linear irreducibles is that I don't know what the solutions to these factors 'look like'. For example, in the linear case it is easy to use facts about lines to say either they are equal, intersect at one point, or never intersect at all. However, for these curves induced by polynomials of a higher degree, I don't what properties they have. Just as an example, how would I rule out the curve of $f$ doesn't 'look like' a sine function where the line $g$ acts as the 'x' axis? I know it's almost certainly not an affine variety, but I don't know how to prove it.
Write $g(x,y) = ax + by + c$, and assume without loss of generality that $b\neq 0$. Solve for $y$ and substitute into $f(x,y) = 0$. The result is a polynomial $p(x)$ in one variable with $\text{deg}(p) \leq \text{deg}(f)$. Distinct solutions to $f(x,y) = g(x,y) = 0$ give distinct solutions to $p(x) = 0$, so the number of solutions is at most $\text{deg}(p)$, and hence at most $\text{deg}(f)$.