Where do we need compactness in this proof? 
Let $X$ be a metric space and $f:X\to X$ continuous. A dynamical system is called positively expansive if $$\exists c > 0 \ \ \forall x, y \in X \ \left( x \neq y \implies  \exists n \geq 1: d(f^n(x), f^n(y)) > c   \right).$$

According to my lecture notes, if $X$ is compact, positive expansiveness can be characterized topologically:

Let $X$ be compact. Then $f$ is positively expansive iff there is a neighborhood $U$ of the diagonal $\Delta_X$ such that for all $(x,y)\in U \setminus \Delta_X$ holds $\mathcal O_{f \times f}(x,y)\not\subseteq U$.

Where 
$\Delta_X := \{(x,y)\in X\times X \mid x=y \}$
$(f \times f)^n (x,y) := (f^n(x), f^n(y))$
$\mathcal O_{f \times f}(x,y):= \{(f \times f)^n (x,y) \mid n\geq1  \}$

The proof appears to be trivial with $U := \{ (x,y)\in X\times X \mid d(x,y) < c \}$ in one direction and a slight variation in another direction.
But where do we need compactness here? 
Added:
"A slight variation in another direction":
$U\subseteq X\times X$ is a neighborhood of the diagonal $\Delta_X$ iff there exists $a > 0$ such that $V_a:= \{ (x,y)\in X\times X \mid d(x,y) < a \} \subset U$. Now with $c:=a$ we get the definition of positive expansiveness.
 A: The problem with your proof is that your definition/characterization of a neighborhood of the diagonal is not correct.
You have that for each $(x,x)$ there is some $d_x$ such that the the ball of radius $d_x$ is inside $U$. But this $d_x$ can depend on $x$ and you get no uniform bound in general. 
You need that $X$ is compact for your statement regarding a $V_a$ to be true. 
A: Here is a concrete example showing failure of the result for a non-compact space. As you’ll see, the nbhd $U$ of the diagonal used to verify that it is an example fails to satisfy your characterization of nbhds of the diagonal of a metric space; as others have noted, that characterization holds only for compact spaces.
Let $X=(0,1)$ with the usual metric, and let $f:X\to X:x\mapsto\frac{x}2$; evidently $f$ is not positively expansive. For $n\in\Bbb N$ let
$$p_n=\left\langle\frac1{2^n},\frac1{2^n}-\frac1{2^{2n+1}}\right\rangle=\left\langle\frac1{2^n},\frac{2^{n+1}-1}{2^{2n+1}}\right\rangle\;,$$
so that $p_0=\left\langle 1,\frac12\right\rangle$, $p_1=\left\langle\frac12,\frac38\right\rangle$, $p_2=\left\langle\frac14,\frac7{32}\right\rangle$, and so on. Let $S_n$ be the line segment with endpoints $p_n$ and $p_{n+1}$, and let $S=\bigcup_{n\in\Bbb N}S_n$. Let $S'$ be the reflection of $S$ in the diagonal $y=x$ together with the segment with endpoints $\left\langle\frac12,1\right\rangle$ and $\langle 1,1\rangle$. Finally, let $U$ be the set of points of $X\times X$ lying strictly between $S$ and $S'$; clearly $U$ is a symmetric open nbhd of $\Delta_X$.
Suppose that $0<b<a<1$. Let $m=\frac{b}a<1$; the orbit of $\langle a,b\rangle$ under $f\times f$ lies on the line $y=mx$. For each $n\in\Bbb N$ we have
$$\frac{\frac{2^{n+1}-1}{2^{2n+1}}}{\frac1{2^n}}=\frac{2^n\left(2^{n+1}-1\right)}{2^{2n+1}}=1-\frac1{2^{n+1}}\;,$$
so $p_n$ lies on the line $y=\left(1-\frac1{2^{n+1}}\right)x$, and clearly $1-\frac1{2^{n+1}}>m$ for all sufficiently large $n$, so the orbit of $\langle a,b\rangle$ under $f\times f$ eventually leaves $U$.
A: First we need the following
Lemma. Let $M$ be a metric space. If $K\subset M$ is compact and $V\subset M$ is an open set such that $K\subset V$, then there exists $\delta>0$ such that $\bigcup_{k\in K}B(k,\delta)\subset V$, where $B(k,\delta):=\{y\in M:d(k,y)<\delta\}$.
It's not hard to prove this.

For each $k\in K$ there exists $\delta_k>0$ such that $B(k,\delta_k)\subset V$. The compactness of $K$ allows us to take $k_1,\dots,k_n\in K$ such that $K\subset\bigcup_{i\leq n}B\left(k_i,\frac{\delta_{k_i}}{2}\right)$. We claim that $\delta=\min\{\frac{\delta_{k_1}}{2},\dotso,\frac{\delta_{k_n}}{2}\}$ does the job. In fact, if $x\in \bigcup_{k\in K}B(k,\delta)$, then $d(x,k)<\delta$ for some $k\in K$, hence there exists $j\leq n$ such that $d(k,k_j)<\frac{\delta_{k_j}}{2}$, and $d(x,k_j)\leq d(x,k)+d(k,k_j)<\delta+\frac{\delta_{k_j}}{2}\leq \delta_{k_j}\Rightarrow x\in B(k_j,\delta_{k_j})\subset V.$

If you consider $X\times X$ endowed with the metric $d'((x,y),(x',y'))=\max\{d(x,x'),d(y,y')\}$, notice that
$$V_\delta=\{(x,y):d(x,y)<\delta\}\subset\bigcup_{x\in X}B'((x,x),\delta),$$
where $B'((x,x),\delta)$ is the open ball in $X\times X$ in the metric $d'$. Since $X$ is compact Hausdorff, it follows that $\Delta_X$ is compact, so we can apply the lemma replacing $M$ and $K$ by $X\times X$ and $\Delta_X$, respectively.
Finally, if you have a neighborhood $U$ as in your question, then there exists an open set $V$ such that $\Delta_X\subset V\subset U$, and you may apply the lemma, obtaining $\delta>0$ such that
$$\Delta_X\subset V_\delta\subset \bigcup_{x\in X}B'((x,x),\delta)\subset V\subset U.$$
