Proof:
Let $x$ be a real number, since $f(x)$ is differentiable, or $\lim_{x \to a} \frac{f(x)-f(a)}{x-a}$ exists and is equal to $f'(a)$. So, for any $\epsilon' > 0$ there exists a $\delta > 0$, such that $0<|x-a| < \delta$
$\implies |\frac{f(x)-f(a)}{x-a} - f'(a)| < \epsilon'$
Using the Triangle inequality, we get
$ |\frac{f(x)-f(a)}{x-a}| < \epsilon' + |f'(a)|$
$\implies |f(x)-f(a)| < \epsilon' \delta + |f'(a)| \delta$
Here's where I start getting unsure whether my proof is correct or not. This inequality is true for $\epsilon'$ = $\frac{\epsilon}{\delta'} - |f'(a)|$ where $\delta' < \delta$ such that $\frac{\epsilon}{\delta'} > |f'(a)|$
This gives us
$ |f(x)-f(a)| < \epsilon$
The logic behind the proof is that if someone gives asks me to find an appropriate delta for $\epsilon = h$, I'll find a delta for $\epsilon' = h$, say that delta is equal to $n$. Next I solve for $\epsilon'$ using $\epsilon' = \frac{h}{n} - |f'(a)|$. If on solving I get a negative $\epsilon'$, I decrease $\delta'$ to a value $n_0$ such that I get a positive value for $\epsilon'$ and then get the corresponding delta, $n_1$. The minimum of $n_1$ and $n_0$ would be the required delta.
Please let me know where exactly the proof starts to go wrong. While alternate proofs are appreciated, the main goal here is understanding why this proof is wrong.
EDIT: After thinking about the problem for a while and reading a few of the answers, I found a way to communicate the idea more effectively.
Continuing from $|f(x)-f(a)| < (\epsilon' + |f'(a)|) \delta$
Now we need to show that we can represent any positive real number, $\epsilon$, by taking appropriate values of $\delta$ and $\epsilon'$. Fix $\epsilon' = 1$. Now $\delta$ is just $\frac{\epsilon}{1+|f'(a)|}$. To complete our answer, let one value of $\delta$ for $\epsilon' = 1$ be $\delta_0$. Our final answer would be $\delta = \min(\delta_0,\frac{\epsilon}{1+|f'(a)|})$
I try to put your arguments in the right order.
Proof:
Assume that $f$ is differentiable in $a$. So $f'(a)$ exists.
To prove that $f$ is continous in $a$ choose an arbitrary $\varepsilon>0.$ Now you can choose $\delta_1$ such
$$0<\delta_1<\frac{\varepsilon}{|f'(a)|}, \text{ if } f'(a)\ne 0$$ $$\delta_1=1, \text{ if } |f'(a)|=0.$$ So we have $$0<|f'(a)|<\frac{\varepsilon}{\delta_1}$$ and define $$\varepsilon_2=\frac{\varepsilon}{\delta_1}-|f'(a)|>0$$
Because f is differentiable in $a$ we can find a $\delta_2$ such that $$|\frac{f(x)-f(a)}{x-a} - f'(a)| < \varepsilon_2,\; \forall x: 0<|x-a|<\delta_2$$
Using the triangle inequality, we get
$$ |\frac{f(x)-f(a)}{x-a}| < \varepsilon_2 + |f'(a)|,\; \forall x: 0<|x-a|<\min(\delta_1,\delta_2)$$
So we set $$\delta=\min(\delta_1,\delta_2)$$ and get $$| f(x)-f(a)| < (\varepsilon_2 + |f'(a)|) \delta_2<\frac{\varepsilon}{\delta_1}\min(\delta_1,\delta_2)\le \varepsilon,\; \forall x: 0<|x-a|<\delta$$