Translation operator and continuity

I came across a text that proves that translation operator $T_a(f):=f(x-a)$ where $a\in\mathbb{R}^n$ and $f\in L^p(\mathbb{R}^n)$ is continuous. The proof follows:
$$||f(x-a)-f(x)||_p=||f(x-a)-g(x-a)+g(x-a)-g(x)+g(x)-f(x)||_p\leq ||f(x-a)-g(x-a)||_p+||g(x-a)+g(x)||_p+||g(x)-f(x)||_p<3\varepsilon$$
Where $g$ is some continuous function and hence $C^\infty$ is dense in $L^p$ the inequality holds. Wouldn’t that meant $f$ is also continuous which it doesn’t have to be? Why does the proof hold, respectively what is the catch with the proof, why isn’t it the proof of continuity of $f$?

Solutions Collecting From Web of "Translation operator and continuity"

First of all, in the proof you need to assume something else about the function $g$. Usually one takes $g\in C_c(\mathbb{R}^n)$, the space of continuous functions with compact support. This implies that $g$ is uniformly continuous, allowing one to prove that $\|g(x-a)-g(x)\|_p\to0$ as $a\to0$.

The proof shows that
This is very different of continuity of $f$ , which would be
\lim_{a\to0}|f(x-a)-f(x)|=0\quad\forall x\in\mathbb{R}^n.

Your statement in the comments that an operator $T$ is continuous on a Banach space $X$ if, for a sequence $f_n \rightarrow f$ in $X$ then we have $Tf_n \rightarrow Tf$. That is about the operator $T$ being continuous. The functions $f_n$ and $f$ are simply an arbitrary collection of elements in the space that form a convergent sequence and its limit.

Consider that the definition of a continuous operator makes sense even on a space where the elements are not functions themselves!