\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{arrows.meta,decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\draw[stealth-stealth] (-6,0) node[below]{$-\infty$} -- (6,0) node[below]{$\infty$};
\draw foreach \X in {-4,-3,...,4} {(\X,.1) -- (\X,-.1) node[below=0.2em]{$\X$}};
\draw[very thick,red] (0,0.06) -- (4,0.06);
\draw[very thick,red,{Bracket[width=1.2em]}-{Bracket[width=1.2em]}] (0,0) -- (4,0) node[pos=3/4,above]{$J$};
\draw[very thick,blue,{Bracket[reversed,width=1.2em]}-{Bracket[width=1.2em]}] (-3.05,0) -- (2,0) node[pos=1/5,above]{$I$};
\draw[decorate,decoration=brace] (-3,0.5) -- (4,0.5) node[midway,above=0.1em]{$I\cup J$};
\end{tikzpicture}
\begin{tikzpicture}
\draw[stealth-stealth] (-6,0) node[below]{$-\infty$} -- (6,0) node[below]{$\infty$};
\draw foreach \X in {-4,-3,...,4} {(\X,.1) -- (\X,-.1) node[below=0.2em]{$\X$}};
\draw[very thick,red] (0,0.06) -- (4,0.06);
\draw[very thick,red,{Bracket[width=1.2em]}-{Bracket[width=1.2em]}] (0,0) -- (4,0) node[pos=3/4,above]{$J$};
\draw[very thick,blue,{Bracket[reversed,width=1.2em]}-{Bracket[width=1.2em]}] (-3.05,0) -- (2,0) node[pos=1/5,above]{$I$};
\draw[decorate,decoration=brace] (0,0.5) -- (2,0.5) node[midway,above=0.1em]{$I\cap J$};
\end{tikzpicture}
\end{document}