Q:

problem with \mathaccent when \usepackage{hyperref} is loaded

Here is a MWE.
\documentclass[a4,12pt]{report}

\usepackage{amssymb}
\usepackage{amsmath}

\renewcommand{\.}[1]{\ensuremath{\mathrm{#1}}}
\newcommand{\+}[1]{\ensuremath{\mathbf{#1}}}
\newcommand{\ud}{\mathop{}\!\mathrm{d}}

%\usepackage{hyperref}

\begin{document}

Let $\.f(x) = (x+2a)^3 -27 a^2 x$, where $a\ge 0$. 
By sketching  $\.f(x)$, show that $\.f(x)\ge 0$ for~$x \ge0$. 

\end{document}

I think I have located the problem now. But not sure why this happens.
Everything is fine without \usepackage{hyperref}. But when I have loaded the package, it can't compile with latex myfile.tex. Error message says

Please use \mathaccent for accents in math mode. \add@accent ...@spacefactor \spacefactor }\accent #1 #2\egroup \spacefactor ...  

I am using latex -> dvips -> ps2pdf to compile.

A:

The reason latex has \newcommand which generates an error if over-writing an existing command is to make this kind of error less likely. \. is a core latex command and shouldn't be redefined (unless you are redefining all of latex's text handling, eg for unicode tex variants rather than classic tex etc.) Redefining it will break documents even if they do not have \. explicitly:
\documentclass{article}

\begin{document}

\emph{Ġood}

\renewcommand{\.}[1]{\ensuremath{\mathrm{#1}}}

\emph{Less Ġood}

\end{document}

Generates no error but produces 

However if you really must do this and simply changing the command to any other name is not a possibility, simply move the \renewcommand\. line after \usepackage{hyperref} the latex text handling is then still broken but hyperref's checks on accent commands are over-written as well so adding hyperref doesn't make things even worse.
\documentclass[a4paper,12pt]{report}

\usepackage{amssymb}
\usepackage{amsmath}

\newcommand{\+}[1]{\ensuremath{\mathbf{#1}}}
\newcommand{\ud}{\mathop{}\!\mathrm{d}}

\usepackage{hyperref}
\renewcommand{\.}[1]{\ensuremath{\mathrm{#1}}}% not recommended, use a different name!

\begin{document}

Let $\.f(x) = (x+2a)^3 -27 a^2 x$, where $a\ge 0$. 
By sketching  $\.f(x)$, show that $\.f(x)\ge 0$ for~$x \ge0$. 

\end{document}

