\documentclass{article}

\usepackage{pgfplots}

\pgfplotsset{compat=1.9}

% \usetikzlibrary{}
% \usepgfplotslibrary{}

\begin{document}

\pgfplotsset{samples=2}

\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}[
		axis x line=center,
		axis y line=center,
		hide obscured x ticks=false,
		hide obscured y ticks=false,
	]
	\addplot {x};
	\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}[
		axis x line=center,
		hide obscured x ticks=false,
		hide obscured y ticks=false,
		xtick={-5,-4,...,5},
	]
	\addplot {x};
	\end{axis}
\end{tikzpicture}
\end{document}

