Let $I\subset \mathbb{R}$ be an interval, $p\in I$, and $f : I\to \mathbb{R}$ a function.
Prove that $f$ is differentiable at $p$ if and only if there is a function $\phi:I\to \mathbb{R}$ that is continuous at $p$ and $$f(x)=f(p)+(x-p)\phi(x)$$ is fulfilled. Moreover if such a function $\phi$ exists then $$f'(p)=\phi(p).$$ HINT: This is largely a restatement of the usual definition of derivative.
I know that for a function to be differentiable then the derivatives from the left and right must be equal. Just not sure where to start with this one.