Let $C=\{f\in C[0,1]: f(0)=f(1)\}$. I need to show that $C$ is closed in $C[0,1]$ with respect to $||f||_{\infty}=\max(f)$.
I know that I can define $\phi(f)=f(0)-f(1)$ and then argue that $\phi$ is continuous and $C=\phi^{-1}(\{0\})$. But I wanted to do it in another way:
Proof Let $(f_n)_n$ be a sequence in $C$ s.t. $$f_n\stackrel{||\cdot||_\infty}{\longrightarrow}f\in C[0,1]$$ I want to show that $f\in C$. But now consider $$\begin{align}|f_n(0)-f(0)|&\leq\max_x|f_n(x)-f(x)|\\&=||f_n-f||_\infty\rightarrow0\end{align}$$Similarly for $f_n(1)$. So we get $\lim_nf_n(0)=f(0)$ and $\lim_nf_n(1)=f(1)$, but since the limit is unique and for all $n$ we have $f_n(0)=f_n(1)$, we deduce that $f(0)=f(1)$ and therefore $f\in C$.
Now my question is does this work or am I wrong?