We have a function $f$ and a sequence of functions $f_n$, both on $[a,b] \to \mathbb{R}$. $f_n$ is continuous for each $n \in \mathbb{N}$, and $f_n$ converges pointwise to $f$. I am asked to give an example to show this does not imply that $f$ is continuous.
My thinking so far is that the example must break down on the boundaries, since within $(a,b)$, we pick the same $\epsilon>0$ for both definitions of continuity and pointwise convergence, we get an epsilon-delta rectangle about each point which both $f_n(x)$ and $f(x)$ must be in, so as epsilon shrinks we can define a slightly larger epsilon to get continuity of $f$. I can't get an example where it breaks though.
Is my reasoning sound, and any hints for getting an example that breaks this?
As pointed out in the comments, the problem may be at boundaries or it may not.
Considering $a=0$, $b=1$ and $f_n\colon x\mapsto x^n$, the sequence converges pointwise to the function $f$ such that $f(x)=0$ for $0\leqslant x\lt 1$ and $f(1)=1$, which is not continuous.
Let $a=0$, $b=1$, $f_n$ equal to $1$ on $[0,1/2-1/n)$, $-1$ on $(1/2+1/n,1] $ and linear on $(1/2-1/n,1/2+1/n)$. Then $f_n$ is continuous and converges pointwise to $f$, which equals $1$ on $[0,1/2)$, $-1$ on $(1/2,1]$ and $0$ at $1/2$, which is not continuous.