I have solved the following exercise and I would like to know if I have made any mistakes. Thank you.
Problem: Let $h_n(x)=$ \begin{cases} 1 & \text{if $x=\frac{1}{n}$}\\ x & \text{if $x=1,\frac{1}{2},\dots,\frac{1}{n-1}$}\\ 0 & \text{otherwise} \end{cases} and let $h$ be the pointwise limit of $h_n$. Is each $h_n$ continuous at $0$? Does $h_n\to h$ uniformly on $\mathbb{R}$? Is $h$ continuous at $0$?
My solution:
Let $\varepsilon>0$, fix $n\geq 1$ and set $\delta:=\frac{1}{n}$: then $|x-0|<\delta$ implies $|h_n(x)-h_n(0)|=|h_n(x)-0|=|h_n(x)|=0<\varepsilon$ (note that $h\equiv 0$ for $x\in [0,\frac{1}{n})$) so each $h_n$ is continuous at $0$. Now, let $N\geq 1$, and $m,n\geq N$ (we can assume wlog $m>n$): then $|h_m(x)-h_n(x)|=$ \begin{cases} 0 & \text{if $x=1,\frac{1}{2},\dots,\frac{1}{n-1},\frac{1}{n}$} \\ x & \text{if $x=\frac{1}{n+1},\frac{1}{n+2},\dots,\frac{1}{m-1}$} \\ 1 & \text{$x=\frac{1}{m}$} \\ 0 & \text{otherwise} \end{cases} so if we pick $\varepsilon=\frac{1}{2}$ we have $|h_m(\frac{1}{m})-h_n(\frac{1}{2m})|=|1-0|=1>\varepsilon$. So we have shown there exists a $\varepsilon>0$ and $x\in\mathbb{R}$ such that for all $N\geq 1$ and $m,n\geq N$ we have $|h_m(x)-h_n(x)|=1>\varepsilon$ thus by the Cauchy Criterion for Uniform Convergence we have that $h_n$ does not uniformly converge on $\mathbb{R}$.
EDIT: (first part is fine, following second part corrected according to answer below by José Carlos Santos)
Now, let $\varepsilon>0$ and set $\delta:=\frac{\varepsilon}{2}$: then $|x-0|<\delta$ implies $|h(x)-h(0)|=|h(x)-0|=|h(x)|\leq\frac{\varepsilon}{2}<\varepsilon$ so $h$ is continuous at $0$.
You proved correctly that the convergence is not uniform. However, $h$ is continuous at $0$, since$$h(x)=\begin{cases}x&\text{ if }x\in\left\{1,\frac12,\frac13,\ldots\right\}\\0&\text{ otherwise.}\end{cases}$$