# Proving continuity of a function using epsilon and delta

I've just got a real quick question about proving the continuity of a function using $\epsilon$ and $\delta$ definition of continuity. The question is this:

Let $f\colon X\to R$ be continuous where $X$ is some subset of $R$. Prove that the function $1/f\colon x\mapsto 1/f(x)$ is continuous at $p$ in $X$, provided that $f(p)\neq0$.

The definition states that "A function $f(x)$ is continuous at $p$ iff for every $\epsilon>0$ there exists some $\delta>0$ such that $|x-p|<\delta$ and $|f(x) -f(p)|<\epsilon$

After that, I am super stuck...any help would be greatly appreciated. Thanks!

Let $\epsilon>0$ be an arbitrary number. Since the function $f$ is continuous at $p$ and $f(p)\ne 0$, there exists a number $\delta>0$ such that $|f(x)-f(p)|<\min\{\epsilon|f(p)|^2/2, |f(p)|/2\}$ for each $x\in X$ such that $|x-p|<\delta$. Then
$$\left|\frac 1{f(x)}-\frac 1{f(p)}\right|=\left|\frac {f(p)-f(x)}{f(x)f(p)}\right|\le$$ $$|f(p)-f(x)|\cdot\frac 1{|f(p)|}\cdot \frac 1{|f(x)|} \le \frac{\epsilon|f(p)|^2}{2}\cdot \frac 1{|f(p)|}\cdot\frac 2{|f(p)|}=\epsilon.$$