The character ' is already taken for denoting, in math mode, a prime like in derivatives; in text mode it produces an apostrophe/right quote.
You can define a new math symbol font (if you have room for it}
\documentclass{article}
\usepackage{textcomp} % for TS1
\usepackage{amsmath}
\DeclareSymbolFont{textsymbols}{TS1}{\familydefault}{m}{n}
\SetSymbolFont{textsymbols}{bold}{TS1}{\familydefault}{m}{n}
\DeclareMathSymbol{\ulq}{\mathopen}{textsymbols}{39}
\DeclareMathSymbol{\urq}{\mathclose}{textsymbols}{39}
\begin{document}
\begin{equation}
f(x) = \log\ulq x \urq
\end{equation}
\end{document}
Otherwise a less efficient definition that spares a math group, but requires some more work for respecting \boldmath:
\documentclass{article}
\usepackage{textcomp} % for TS1
\usepackage{amsmath}
\newcommand{\ulq}{\mathopen{\textnormal{\textquotesingle}}}
\newcommand{\urq}{\mathclose{\textnormal{\textquotesingle}}}
\begin{document}
\begin{equation}
f(x) = \log\ulq x \urq
\end{equation}
\end{document}

If you want upright text in your equation:
\begin{equation}
\textnormal{sometext}=\ulq\textnormal{abc}\urq
\end{equation}
but this is a different thing than straight quotes.
\text{sometext}, which requires\usepackage{amsmath}(ormathtools, good chance you have one of them in the preamble already). – Torbjørn T. Oct 11 '16 at 18:43upquotepackage is recommended. – barbara beeton Oct 11 '16 at 19:14