First of all be warned, that it is not recommended to use such special chars in your math source code, as they are very hard to distinguish from each other. For example look at ğ (\breve{g}) and ǧ (\check{g}) or ı (dottless i U+0131) and ι (\iota).
If you still need it, the way to go these days is to use either xetex or luatex for compilation and the unicode-math package. In this example, my math font does not contain a native character ğ, so I also have to declare it with \newunicodechar:
\documentclass{article}
\usepackage{fontspec,unicode-math}
\setmainfont[Mapping=tex-text]{STIXGeneral}
\setmathfont{XITS Math}
\usepackage{newunicodechar}
\newunicodechar{ğ}{\ifmmode\breve{g}\else ğ\fi}
\begin{document}
Text-mode: ğ,ı and math-mode: $ğ,ı$.
\end{document}
$\hat{g}$? – egreg Aug 02 '12 at 17:09