So, I'm trying to prove the following limit directly using the definition:
$\lim_{x \to 2} (x^2+2x+4) = 12$
Proof Attempt:
Define:
$f(x) = x^2+2x+4$
$L = 12$
We have to prove that for any $\epsilon > 0$, there exists a $\delta > 0$ such that:
$0 < |x-2| < \delta \implies |f(x)-L| < \epsilon$
So, consider the absolute value of the difference:
$|f(x)-L| = |x^2+2x-8| = |(x+4)(x-2)| = |x+4| \cdot |x-2| < \epsilon$
for any $\epsilon >0$. Now, consider the following:
$|x+4| \cdot |x-2| = |(x-2)+6| \cdot |x-2| \leq |x-2|^2 + 6 \cdot |x-2| = [|x-2|+3]^2-9 < \epsilon$
$ \implies |x-2| < -3 + \sqrt{9+\epsilon}$
Now, pick $\delta = -3 + \sqrt{9+\epsilon}$, so that:
$0 < |x-2| < -3 + \sqrt{9+\epsilon}$
Since our required $\delta > 0$ exists so that $|f(x)-L| < \epsilon$, it follows that the desired limit holds.
Is the proof above correct? If it isn't, how can I fix it?
No. Your answer is correct but may be improved. Let us clarify something. A point $x$ that satisfies the inequality $0<|x-x_0|<\delta$ for some $\delta>0$ is a point "close" to $x_0$ but different from $x_0$. How "close" ? close enough that it lies in a $\delta$-neighborhood of $x_0$. A $\delta$-neighborhood of $x_0$ (in this context) is simply the open interval $]x_0-\delta, x_0+\delta[$. So when we say we are going to show that there exists $\delta>0$ such that every point $x$ that satisfies the inequality $0<|x-2|<\delta$, must also satisfy the inequality $|f(x)-L|<\epsilon$, we are saying that we are going to prove that there exists a $\delta$-neighborhood "a small enough neighborhood" of the point $x_0$ such that each $x$ that lies in that neighborhood, but different from $x_0$, has an image $f(x)$ that satisfies $|f(x)-L|<\epsilon$.
So, the smaller $\epsilon$ is, the smaller $\delta$ will be. That is the closer we require the image $f(x)$ to be to the number $L$, the closer $x$ much be to the point $x_0$.
You can improve your answer in a number of ways. Here is one:
When $|x-2|<\delta$, we have
$|f(x)-L|\leq |x+4| \cdot |x-2| = |(x-2)+6| \cdot |x-2| \leq |x-2|^2 + 6 \cdot |x-2| < \delta^2+6\delta<7\delta < \epsilon$
So, pick $\delta <\epsilon/7$.