\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}

\begin{document}

\tableofcontents
\section{Chapter 5}
\subsection{Section 1}

\end{document}


I only want the top part to display, I don't know why it's duplicating. Also, how can I delete the numbers on the left side of the titles? And how can I set up the page number for each section and title?

Among other things, your document setup suffers from mis-using of the directives \section and \subsection to generate headers that are labeled "chapter" and "section", respectively. To reduce the confusion that will inevitably follow, you may want to switch to the report document class, issue the instruction \setcounter{secnumdepth}{-1} in the preamble, and use the directives \chapter and \section to generate the corresponding headers.

\documentclass{report} % not 'article'
\setcounter{secnumdepth}{-1}

\begin{document}
\tableofcontents

\chapter{Chapter 5}
\section{Section 1}
\end{document}


\documentclass{report} % not 'article'
\setcounter{secnumdepth}{-1}

\begin{document}
\tableofcontents

\begingroup
\let\clearpage\relax % locally disable '\clearpage'
\chapter{Chapter 5}
\endgroup
\section{Section 1}
\end{document}