Physics.SE and Math.SE both use MathJax to render their math content. This requires the use of the following syntax
$$
<math>
$$
for display math content, and $<math>$ for inline math content. While this does work for MathJax, you need a little more in order to write an equation with tags using Overleaf:

\documentclass{article}
\usepackage{amsmath}
\setlength{\parindent}{0pt}% Just for this example
\begin{document}
Display equation without label:
\[
f(x) = ax^2 + bx + c
\]
The above is similar to
\begin{equation*}
f(x) = ax^2 + bx + c.
\end{equation*}
Display equation with label to \eqref{eqn:quadratic1}:
\begin{equation}
f(x) = ax^2 + bx + c \label{eqn:quadratic1}
\end{equation}
Display equation with custom label to \eqref{eqn:quadratic2}:
\begin{equation}
f(x) = ax^2 + bx + c \tag{quadratic} \label{eqn:quadratic2}
\end{equation}
\end{document}