I am trying to solve the following problem:
Let $f(x) = x^2$ and let $\epsilon > 0$ be given.
Find a $\delta$ so that $|x - 2| \leq \delta \implies |f(x) - 4| \leq \epsilon$.
I've rewritten the $\epsilon \text{-} \delta$ condition thusly,
\begin{align*} |f(x) - 4| = |x^2 - 4| = |(x-2)(x+2)| = |x - 2||x + 2| &\leq \epsilon\\ |x - 2| &\leq \frac{\epsilon}{|x+2|}. \end{align*}
Therefore, choose $\delta \leq \frac{\epsilon}{|x+2|}$ (which is positive since $|x+2|$ is positive).
Then we have \begin{align*} |x-2| \leq \delta \leq \frac{\epsilon}{|x+2|} \implies |f(x) - 4| \leq \epsilon. \end{align*}
Is this right? Are you allowed to define $\delta$ in terms of $x$?
Yes, you are allowed to use $x$ when choosing $\delta$ but that would be done when you were doing the limit at an unknown point $x$. An example would be proving the continuity of $f(x)=x^2$ at any point $x \in \Bbb R$
When you are proving continuity at a given point it is necessary to set a hard upper limit for $\delta$. If you say "Let us guarantee that $\delta \lt \frac 12$", for example, then $x+2$ is less than $\frac 52$ so your $\delta \lt \frac {\epsilon}{|x+2|}$ can have $\le \frac {2\epsilon}5$ added and you have a limit for $\delta$ that does not depend on $x$.
If you haven't seen it already there is the notion of uniform continuity were you are not allowed to vary $\delta(\epsilon)$ as a function of $x$. This is a stronger notion, which is required for a number of theorems.