\documentclass[tikz,preview]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{backgrounds, calc, positioning, fit}
\pgfplotsset{compat=newest}

\newcommand{\code}[1]{\texttt{#1}}
\begin{document}
\begin{figure}
	\centering
	\begin{tikzpicture}
	% Set grid size
	\def\xmax{12}
	\draw[step=1cm, gray!50!white, very thick] (1,0) grid (\xmax-1,0);
	\draw[step=1cm, gray!50!white, very thin] (1,0) grid (0,0);
	\draw[step=1cm, gray!50!white, very thin] (\xmax-1,0) grid (\xmax-0.5,0);
	
    \foreach \x in {1,...,\xmax} {
	\ifnum\x=1
	\draw[->, thick, red!80!black, line width=1pt] (\x-0.4,0) -- ++(0.001,0);
	\else
	\ifnum\x=\xmax
	\draw[->, thick, red!80!black, line width=1pt] (\x-0.4,0) -- ++(0.001,0);
	\else
	\draw[->, thick, green!70!black, line width=1pt] (\x-0.4,0) -- ++(0.001,0);
	\fi
	\fi
    }

	\foreach \x in {1,...,\xmax}
	\fill[blue] (\x-1,0) circle (2pt);
	\node at (1.25,-0.5) {\(x_{\min}\)};
	\node at (\xmax-0.75,-0.5) {\(x_{\max}\)};
	
	\node at (0,0.5) { 0};
	\node at (1,0.5) {1};
	\node at (2,0.4) {\dots};
	\node at (9,0.4) {\dots};
	\node at (10,0.5) {\small \code{Nx}};
	\node at (11,0.5) {\small \code{Nx+1}};
\end{tikzpicture}
\end{figure}

\end{document}
