The test document
\documentclass[a4paper]{article}
\begin{document}
Some text to fill a couple of lines before some displayed
equation that is centered on a line by itself
\begin{center}
$f(g_{1})=f(g_{2})$
\end{center} \\
and some text following the display.
\end{document}
stops with the error
! LaTeX Error: There's no line here to end.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.10 a
nd some text following the display.
that should be self-explaining: there is no line to end after \end{center}. If you go past the error by hitting return, the document is produced:

The same would be obtained by omitting \\.
On the other hand, this is not the preferred method for displaying equations:
\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
Some text to fill a couple of lines before some displayed
equation that is centered on a line by itself
\begin{equation*}
f(g_{1})=f(g_{2})
\end{equation*}
and some text following the display.
\end{document}

Instead of \begin{equation*}...\end{equation*} you can use \[...\] (but the former is more convenient if you later decide to number your equation and just removing * is sufficient).
There are some subtle differences in the output, but the main one is that no page break can happen before the display. Remember not to leave a blank line before the display itself.
And remember that \\ is not the method of choice to end paragraphs, for which a blank line should be used.
Please, make sure to read an introductory guide to LaTeX: see Where do I start LaTeX programming?
\\after\end{center}to begin with? Do you know about\[...\], which is actually what you want? – egreg Jul 15 '18 at 21:22\\It can only be used at the end of a line with content, you can't use it at the start of a line. After the\end{center}you're at the start of a line, so you can't have\\next. You need something in the line. Anything. It will work with.it will work witha, it will work withelementary, my dear Watsonbut it won't work nothing. – Au101 Jul 15 '18 at 21:25\\is for use in tables and things, it's rarely the right thing to be used in the text, @egreg is saying you should havetext text text \[ f(g_{1}) = f(g_{2}), \] text text text. He is right – Au101 Jul 15 '18 at 21:27\\, you could have built up a really bad habit. Now you know =) – Au101 Jul 15 '18 at 21:34tabulars,arrays,matrixenvironments and the like, where you need to end rows. You can also use it in theverseenvironment, which is for poetry, where you want to break lines without ending paragraphs. Only use it to break a line in the middle if you have some positive reason for doing so. Never use it to end a paragraph, produce unjustified text, or something like that and steer clear of it is a quick way of adding a bit of vertical space – Au101 Jul 15 '18 at 21:49