The formation of silicate dust in oxygen-rich envelopes of evolved stars is thought to be initiated by formation of seed particles that can withstand the high temperatures close to the stellar photosphere and act as condensation cores farther away from the star. Candidate species considered as first condensates are TiO and TiO$_2$. We aim to identify and characterize the circumstellar gas-phase chemistry of titanium that leads to the formation of solid titanium compounds in the envelope of $o$ Cet, the prototypical Mira, and seek an observational verification of whether titanium oxides play a major role in the onset of dust formation in M-type AGB stars. We present high angular-resolution ALMA observations at submillimeter (submm) wavelengths supplemented by APEX and Herschel spectra of the rotational features of TiO and TiO$_2$. In addition, circumstellar features of TiO and TiI are identified in optical spectra which cover multiple pulsation cycles of $o$ Cet. The submm ALMA data reveal TiO and TiO$_2$ bearing gas within the extended atmosphere of Mira. While TiO is traceable up to a radius (FWHM/2) of 4.0 R$_{star}$, TiO$_2$ extends as far as 5.5 R$_{star}$ and unlike TiO appears to be anisotropically distributed. Optical spectra display variable emission of TiI and TiO from inner parts of the extended atmosphere (<3 R$_{star}$). Chemical models which include shocks are in general agreement with the observations of gas-phase titanium-bearing molecules. It is unlikely that substantial amounts of titanium is locked up in solids because the abundance of the gaseous titanium species is very high. In particular, formation of hot titanium-rich condensates is very improbable because we find no traces of their hot precursor species in the gas phase. It therefore appears unlikely that the formation of dust in Mira, and possibly other M-type AGB stars, is initiated by titanium oxides.