How to write latex overset and underset: \overset \underset

Latex Overset \overset

\frac{f(x+\delta x)-f(x)}{\delta x}
   \overset{\delta x\to 0}{\longrightarrow}
f'(x)
\[\frac{f(x+\delta x)-f(x)}{\delta x} \overset{\delta x\to 0}{\longrightarrow} f'(x)\]
A \overset{f}{\rightarrow} B
\[A \overset{f}{\rightarrow} B\]

Latex Underset \underset

\frac{f(x+\delta x)-f(x)}{\delta x}
   \underset{\delta x\to 0}{\longrightarrow}
f'(x)
\[\frac{f(x+\delta x)-f(x)}{\delta x} \underset{\delta x\to 0}{\longrightarrow} f'(x)\]
A \underset{f}{\rightarrow} B
\[A \underset{f}{\rightarrow} B\]