I am trying to prove the following version of the closed graph theorem:
Let $(X,d)$ be a complet metric space and let $K \subset M$ be compact. Let $f: K \to K$ be a function such that $\{(x,f(x)) : x \in X\}$ is a closed subset of $K \times K$. Then $f$ is continous. I am having trouble proving this so any help would be appricated.
I know the proof of the Closed graph theorem for Banach spaces by using the bounded inverse theorem. It seems strange to me that you need $f$ to be linear in that case but not in the metric space version, thus I have started to wonder if there might be an error in the statement I am trying to prove?
For complete metric spaces, it's equivalent to show sequential continuity.
Let $(x_n)$ be a sequence in $K$ converging to $x$. Since $K$ is compact, it's closed, so $x\in K.$ Note that $K\times K$ is a compact, so the graph is also compact. Consider the sequence $(x_n, f(x_n))\in K\times K,$ and let $(x_{n_j}, f(x_{n_j}))$ be any subsequence. By compactness, it has a convergent subsequence $(x_{n_{j_k}}, f(x_{n_{j_k}}))$ converging to a point $(y,z)$ in the graph of $f$. Now, we note two things:
$(1)$: $x_n\rightarrow x\implies x_{n_{j_k}}\rightarrow x$. Thus, $y=x.$
$(2)$: Since $(y,z)$ is in the graph, $f(y)=z.$
Combining these two points, $(x_{n_{j_k}}, f(x_{n_{j_k}}))\rightarrow (x,f(x)).$ That is, if we take any subsequence of $f(x_n)$, it has a further subsequence which converges to $f(x).$ Thus, $f(x_n)\rightarrow f(x)$.