The question asked in (ISI-JRF) exam was:
Let $f:\mathbb{R}\times[0,1]\to\mathbb{R}$ be a continuous function and $\{x_n\}$ be a sequence of real numbers converging to $x$. Define $$ g_n(y)=f(x_n,y),0\le y\le1,$$ $$ g(y)=f(x,y),0\le y\le1$$. Show that $g_n$ converges to $g$ uniformly on $[0,1]$
My proof ran as follows: Suppose that the convergence were non-uniform. Then, $\forall N\in\mathbb{N},\exists\epsilon_0>0,\exists y_0\in[0,1]$ such that $n\ge N\implies|g_n(y_0)-g(y_0)|\ge\epsilon_0\implies|f(x_n,y_0)-f(x,y_0)|\ge\epsilon_0\implies f$ is not continuous at $(x,y_0)$, which is a contradiction. Hence, the convergence is uniform.
What is the mistake in my proof and how could it be modified for a right proof. I think dependence of $y_0$ on $N$ is the main problem and that $[0,1]$ being a compact interval has something to do here. Any hints? Thanks beforehand.
Hint: The following is useful.
On any compact rectangle $[x-\alpha, x+\alpha] \times [0,1]$, f is uniformly continuous. There exists $N_\alpha \in \mathbb{N}$ such that $x_n \in [x- \alpha, x+ \alpha]$ for all $n \geqslant N_\alpha$.