I want to show that the function defined by $g_n:[0,4]\to \Bbb{R}$, defined by\begin{align} g_n(t)=\begin{cases}0,& \text{if}\;0\leq t\leq 2,\\\dfrac{n}{2}(t-2),& \text{if}\;2\leq t\leq 2+\frac{2}{n},\\1 &\text{if}\;2+\frac{2}{n}\leq t\leq 4.\end{cases} \end{align} is continuous and Cauchy.
MY TRIAL The sequence of functions is clearly continuous by Pasting Lemma. Next, we show that the sequence of functions is Cauchy.
So, let $m,n\in\Bbb{N},$ be given such that $m\geq n.$ Then,
$$|g_m(t)-g_n(t)|=|0-0|+\left|\dfrac{m}{2}(t-2)-\dfrac{n}{2}(t-2)\right|\left|1-1\right|=0<\epsilon$$
I don't know if this is right. If not, kindly help please!
A sequence is Cauchy if for every $\epsilon$ there exists $N \in \mathbb{N}$ such that $\forall n, m > N$ we have $|g_n-g_m|< \epsilon$. Now let $m > n$. How does the function $(g_m-g_n)(t)$ look like? \begin{align} (g_m-g_n)(t)= \begin{cases} 0 & if\ 0 \leq t \leq 2 \\(\frac{m}{2}-\frac{n}{2})(t-2) & if \ 2 < t \leq 2+\frac{2}{m} \\1-\frac{n}{2}(t-2) & if\ 2+\frac{2}{m} < t \leq 2+\frac{2}{n} \\ 0 & if\ 2+\frac{2}{n} < t \leq 4 \end{cases} \end{align} Now $||g_m-g_n||_1=\int_2^{2+\frac{2}{m}}|(\frac{m}{2}-\frac{n}{2})(t-2)|dt+\int_{2+\frac{2}{m}}^{2+\frac{2}{n}}|1-\frac{n}{2}(t-2)|dt$
If we compute explicitly the integrals we get $||g_m-g_n||_1=\frac{m-n}{m^2}+\frac{(m-n)^2}{nm^2}=\frac{m-n}{mn}<\frac{m}{mn}=\frac{1}{n}$
Let $N \in \mathbb{N}$ such that $N > \frac{1}{\epsilon}$ and we have $||g_m-g_m||_1<\frac{1}{n}<\frac{1}{N}<\epsilon$ and this proves the sequence is Cauchy