Q:

If $f$ is a cont. real function on metric space $X$ and $f(a) > 0$. Show that $\exists \delta >0$ such that $f(x) > 0$ for all $x \in B(a, \delta)$

Suppose $f$ is a continuous real valued function on a metric space $X$ and that $f(a) > 0$ for some $a \in X$. Show that there exists some $\delta > 0$ such that $f(x) > 0 $ for all $x \in B_{(X, d)}(a, \delta)$

Let $f : (X, d) \to (Y, e)$. 
Now if I can find an $\epsilon > 0$ that implies $B_{(Y, e)}\left(f(a), \epsilon\right) \subseteq \{f(x) \in Y \ |\  x > 0\}$, then continuity of $f$ would guarantee the existence of a $\delta > 0$ such that $f(x) > 0 $ for all $x \in B_{(X, d)}(a, \delta)$, but I'm having trouble finding an $\epsilon > 0$.
I've shown that if $f(a) > 0$ for only one $a \in X$ then $f$ is discontinuous, but I'm not sure how to define an open ball centered at $a$ with radius $\epsilon$ that only contains those $f(x) > 0$.
How could I go about finding/constructing an $\epsilon$ that works in this case?

A:

Use $\epsilon = \dfrac{f(a)}{2}$. Then $|f(x) - f(a)| < \epsilon$ implies $f(x) > \dfrac{f(a)}{2}$ and in particular $f(x) > 0$.

