There are many counterexamples to this but some of the easier ones are (built from) polynomials. For this we distinguish two cases:
- Functions on finite intervals, i.e. $(a,b)$ where $-\infty<a<b<\infty$.
Here one can choose something as simple as $f_n(x):=\sqrt n(\frac{x-a}{b-a})^n$. These functions are not only continuous but even analytic, and their sequence converges to the zero function in $L^1([a,b])$
$$
\|f_n-0\|_1=\int_a^b \sqrt n\Big(\frac{x-a}{b-a}\Big)^n=\frac{\sqrt n}{n+1}\Big[\Big(\frac{x-a}{b-a}\Big)^{n+1}\Big]_a^b=\frac{\sqrt{n}}{n+1}\to 0\text{ as }n\to\infty
$$
but not in $L^2([a,b])$
$$
\|f_n-0\|_2=\int_a^b n\Big(\frac{x-a}{b-a}\Big)^{2n}=\frac{n}{2n+1}\Big[\Big(\frac{x-a}{b-a}\Big)^{2n+1}\Big]_a^b =\frac{n}{2n+1}\not\to 0\text{ as }n\to\infty\,.
$$
- Functions on infinite intervals, i.e. $(a,b)$, $a<b$ where $a=-\infty$ or $b=\infty$ (or both)
Because the functions from the previous example satisfy $f_n(a)=0$ they can be continuously extended to $(-\infty,b)$ by $f_n(x):=0$ for all $x\leq a$; this "takes us to infinity" and on the other side of the function we could for example just mirror it. Assume w.l.o.g. that $(-1,1)\subset(a,b)$ (else we can just shift the following function) and define
\begin{align*}
f_n:(a,b)&\to\mathbb R\\
x&\mapsto \begin{cases} \sqrt n(1-|x|)^n&x\in[-1,1]\\0&\text{else} \end{cases}
\end{align*}
for all $n\to\infty$. Again each $f_n$ is continuous and $\|f_n-f\|_1\to 0$ but $\|f_n-f\|_2\to 1\neq 0$ as $n\to\infty$.