I was asked to check if $f_n(x)=\begin{cases} 1-\frac{1}{n}|x| & \text{ if } |x|< n \\ 0& \text{ if } |x|\geq n \end{cases}$ uniformly converges to $f=1, \forall x\in \mathbb{R}$. The requirement is using the definition or theorem of the uniform distance between the functions.
This is my try:
First, I prove the sequence of function converges pointwise to the function $f=1$ for every $x$ as follows:
for $x=0$,$\forall n>0:f_n(0)=1-\frac{1}{n}|0|=1$, so $\lim_{n \to \infty}f_n(0)=\lim_{n \to \infty}1=1$.
for $x\neq 0$, $\forall n>|x|: f_n(x)=1-\frac{1}{n}|x|$, so $\lim_{n\to\infty}f_n(x)=\lim_{n\to\infty}\left(1-\frac{1}{n}|x|\right)=1$
$\Rightarrow$ $f_n(x)\rightarrow f=1, \forall x\in\mathbb{R}$.
Now I check if $f_n(x)$ uniformly converges to $f=1$ on $\mathbb{R}$ or not.
I get stuck here, since I'm not sure about the $\underset{x\in\mathbb{R}}{\sup}\left| f_n(x)-f \right|$.
Then, I come up with another idea: use counterargument! Assume $f_n(x)$ uniformly converges to $f=1$ on $\mathbb{R}$,i.e $\forall \epsilon >0,\exists N\in\mathbb{N},\forall n\in\mathbb{N}: n>N \Rightarrow |f_n(x)-f|<\epsilon,\forall x\in\mathbb{R}$. Now, let's choose $\epsilon=\frac{1}{3}$, then there is a $N\in\mathbb{N}$ such that for all $n\geq N$ we have $|f_n(x)-f|<\frac{1}{3}$ for all $x\in\mathbb{R}$. Let us choose $n=N$ and $x=\frac{N}{2}$. Then we have $|f_N(x)-f|=|1-\frac{1}{N}.\left| \frac{N}{2}\right|-1|=\frac{1}{2}>\frac{1}{3}=\epsilon$. This contradicts the hypothesis! So $f_n(x)$ does not uniformly converge to $f=1$ on $\mathbb{R}$.
Is my argument correct? What should I need to edit and modify? And how about using $\underset{x\in\mathbb{R}}{\sup}\left| f_n(x)-f \right|$ or the definition of uniform convergence directly! It's nice see your answer!