The problem states: suppose you have a function $f(x)$ and a line $g(x)$, $f(x)$ intersects $g(x)$ 3 times in: $x_1<x_2<x_3$. $f(x)$ also has 3 derivatives and its third doesn't vanish in $[x_1,x_3]$. Prove that $f(x)$ has at least one inflection point in $(x_1,x_3)$.
I do not know if my attempt is right:
(1) $\exists z\in (x_1,x_3)|~{}$ $f''(z)=0$: Suppose that it is not the case, by the fact that $f'''(x)\neq 0$ we know that $f''(x)$ constantly increases or decreases. In any case, if $f''(x)\neq 0$ in the interval then $f'(x)$ does in fact constantly decrease or increase, wich an absurd because it has to reach $g'(x)$ at least 2 times, one in the interval $(x_1,x_2)$ and the other on the interval $(x_2,x_3)$.
(2) Definition of inflection point: there are multiple definition for inflection point, if we define it as a point where $f''(x)$ vanish, we have finished. We can also define it as a point $z$ where for every $\epsilon>0 \exists z_1,z_2$ such that $|z-z_i|<\epsilon$ and the graph changes from being behind to being above the funcion. We are going to use this last one for the last step.
(3) Taylor's expansion: At any point in the interval we can take the Taylor's expansion with the Lagrange remainder as: $f(x)=f(z)+f'(z)(x-z)+\frac{f''(z)(x-z)^2}{2!}+\frac{f''(z)(x-z)^3}{3!}$ so, regrouping and taking the $z$ where $f''(z)=0$ we have: $f(x)- (f(z)+f'(z)(x-z))=\frac{f''(z)(x-z)^3}{3!}$ that is, the graph minus the tangent line changes sign from $z-\epsilon$ to $z+\epsilon$ for every $\epsilon>0$.