Let's start off by using the fact that $f$ is continuous. Since $f$ is continuous on $[a,b]$ given $\epsilon>0$ $\exists \delta>0$ such that $$|p-p_0| < \delta => |f(p)-f(p_0)| < \epsilon$$
$\forall p \epsilon[a,b]$
now set $p_0= \alpha$ and assume $f(\alpha)<0$ Now for any neighbourhood around $f(p)$ I should be able to find a neighourhood around $p_0$ such that the condition above holds. Now suppose $f(\alpha)<0$ but the neghbourhood $B(\alpha,\delta)$ does not have any element
p: $f(p)<0$ other than $\alpha$. Then for an $\epsilon < |f(\alpha)|$ I wont be able to find a corresponding $\delta$ Contradiction.
So there should exist $p \epsilon B(\alpha,\delta)$ such that $f(p)<0$
And this proves the existence of a Ball or an interval in that case where all elements are zero, since apply the following statement to all element between $p$ and $\alpha$ and you would end up with an interval consisting of negatives.
Consider $B$ as an interval.
Apply the same for $f(\beta)>0$
What we have also proved is that somewhere the function is equal to $0$