Theorem:
If $f$ is continuous in $a\in D_f$ en $f(a)\ne 0$, then $f$ contains her sign in an environment around a.
Proof:
$\underline {f(a)\gt 0}:$ Take $\epsilon =\dfrac{f(a)}{2}$ then it guarantees the existence of a $\delta\gt 0$ so that
$$|x-a|\lt\delta\Rightarrow f(a)-f(x)\le |f(a)-f(x)|\le \dfrac{f(a)}{2}\qquad(1.1) $$ $$\Longrightarrow |x-a|\lt\delta\Rightarrow 0\lt\dfrac{f(a)}{2}\lt f(x)\qquad (1.2) $$
My following questions are:
Why does it say in step 1.2 f(a) -f(x) and not f(x)-f(a)? Because I'd think I'd take it over from the $\epsilon-\delta$-definition.
And is it correct to explain the step 1.1 to 1.2 as because $|f(a) -f(x)|= -f(a)+f(x)$ and $ f(a) -f(x)$ so that the second one cancels the left side of the inequality at step 1.1?
P.S.:
I know I left the second case $f(a)\lt 0$ out of it but it's analoguous to the former case. The only thing you have to replace is that $\epsilon=\dfrac{-f(a)} {2}$ and alter the inequality.
By using the definition of the absolute value, $(1.1)$ could be rewritten as :
$$ |x-a| <\delta \Rightarrow f(x)\in \left[ \frac{f(a)}{2} , \frac{3\,f(a)}{2}\right]$$
My advice would just be to forget $ f(a) -f(x)$ and just work with $|f(a) -f(x)|$
However, you cannot assume you know the sign of $f(a)-f(x)$ as supposed in yous second point. You have to work with the absolute value instead.
That would allow you to write $-\epsilon<f(a) -f(x)<\epsilon$ or $-\epsilon<f(x) -f(a)<\epsilon$ (your choice) in order to prove $(1.2)$