What is wrong with this proof of that if $f \in C^0$ and defined on an open set of $\mathbb{R}^m$, then $f$ is locally lipschitz Consider this question. I have given a proof below which only uses the openness of the domain and the continuity of the function $f$; however, this result should not be true, but still I cannot find where is the mistake in my proof.
Proof:
Let $f: A \to \mathbb{R}^n$, where $A \subseteq \mathbb{R}^m$ and $A$ is open, and $f \in C^1$. To show that $f$ is locally lipschitz, let $x\in A$ be arbitrary and $U_x$ be a open neighbourhood of $x$ in $A$. Then take a cube around $x$ that is contained in $U_x$. Since $f$ is cont. 
$$m_x \leq f(y) \leq M_x \quad \exists m_x , M_x \in \mathbb{R} \quad \forall y \in C_x.$$
Moreover, the function $h:C_x \to \mathbb{R}^n$ defined by $h(y) = y-x$ is also bounded, say $a_x \leq y-x \leq b_x$, hence we have either
$$1/|y-x| \leq max \{1/|a_x|, 1/|b_x|\}.$$
Also we have either
$$|f(y) - f(x)/ |(y-x)| \leq max \{|M_x - f(x)|/|(y-x)|, |m_x - f(x)|/|(y-x)|\}$$
$ \quad \forall y (\not = x) \in C_x.$
Hence
$$|f(y) - f(x)/ |(y-x)| \leq max \{|M_x - f(x)|/|(y-x)|, |m_x - f(x)|/|(y-x)|\} * max \{1/|a_x|, 1/|b_x|\}$$
But this implies 
Hence $f$ is locally lipschitz. QED
Question:
What is wrong with the above proof ?
 A: Even if the estimates by $\frac{\lvert M_x-f(x)\rvert}{\lvert y-x\rvert}$ and $\frac{\lvert m_x-f(x)\rvert}{\lvert y-x\rvert}$ were justified:

Hence $f$ is locally Lipschitz.

Is it? You did not prove, for instance, that $\sup_{y\in C_x\setminus\{x\}}\frac{\lvert M_x-f(x)\rvert}{\lvert y-x\rvert}<\infty$ (and for good reason, since it's false unless $f(x)=M_x$)
A: Locally Lipschitz means that each $x \in A$ has a neighborhood $N(x) \subset A$ such that $f \mid_{N(x)}$ is Lipschitz, i.e. such that there exists $L \ge 0$ with the property $\lVert f(y) - f(z) \rVert \le L \lVert y - z \rVert$ for all $y, z \in N(x)$. I cannot see how your computations are related to that.
Your argument is this: $A$ is locally compact, therefore it suffices to consider a compact neighborhood $N(x)$. $f$ is bounded on $N(x)$ and you try to use this single fact to show that $f$ is Lipschitz on $N(x)$. But if your argumentation were sound, then each bounded function would be Lipschitz, in particular continuous, which is obviously not true.
In fact it is not true that all $f \in C^0(A)$ are locally Lipschitz. An example is $f : \mathbb{R} \to \mathbb{R}, f(x) = \sqrt{\lvert x \rvert}$: There is no neighborhood of $0$ on which it is Lipschitz. See http://www.mathcounterexamples.net/function-that-is-uniformly-continuous-but-not-lipschitz-continuous/.
