$X=[0,\pi]$, $\mu$ is the Lebesgue measure, $f_{n}(x)=\cos\frac{x}{n}$, $g(x)=1$. I want to see if this sequence of functions converges in measure. I will use an auxiliary set, namely $$ A(\varepsilon,n):=(x\in X:|f(x)-g(x)|\geq \varepsilon).$$ Then $$\begin{align} A(\epsilon,n)&=\{x\in\ [0,\pi]\colon\left|\cos\left(\dfrac{x}{n}\right)-1\right| \geq\epsilon\}\\\\ &=\{x\in\ [0,\pi]\colon 2\left|\sin^{2} \frac{x}{2n}\right|\geq\epsilon\}\\\\ &=\{x\in\ [0,\pi]\colon x\geq 2n\arcsin\left(\sqrt{\frac{\epsilon}{2}}\right)\}\\\\ &=\left[2n\arcsin\left(\sqrt{\frac{\epsilon}{2}}\right),\pi\right]. \end{align}$$ Now, for every $\epsilon\in(0,1)$ we have $$\begin{align}\lim_{n \rightarrow \infty} \mu(A(\varepsilon, n))&=\lim_{n\rightarrow\infty}\left|\pi-2n\arcsin\left(\sqrt{\frac{\epsilon}{2}}\right)\right|\\\\ &=|\pi-\infty|\\\\ &=\infty.\end{align}$$
So there is no convergence in measure.
Are this steps correct? This sequence converges uniformly to 1 an there fore converges point wise. Does it make any sense to check the almost uniform convergence?.
For any $x\in[0,\pi]$ $\lim_n\cos(x/n)=\cos(0)=1$. That is , $\cos(x/n)$ converges pointwise to $1$. It is a well know result that if $f_n\xrightarrow{n\rightarrow\infty} f$ point wise (suffices will pointwise almost surely), then $f_n\xrightarrow{n\rightarrow\infty} f$ in measure. In you case $f_n(x)=\cos(x/n)$ converges point wise and in measure to the constant function $1$.
Here is a short proof of the well known result in a general setting:
Suppose $(\Omega,\mathscr{B},\mu)$ is a measure space. If $\{f_n:n\in\mathbb{N}\}$ is a sequence of measurable functions that converges pointwise almost surely to $f$ and $A\in\mathcal{L}_1$, then by Egorov's theorem, $f$ is measurable and for any $\varepsilon>0$ there is s measureble set $A_0\subset A$ with $\mu(A\setminus A_0)<\epsilon$ on which convergence is uniform. Hence, given $\delta>0$ there is $N\in\mathbb{N}$ such that $\|f_n-f\|_{u,A_0}<\delta$ whenever $n\geq N$ (here $\|\;\|_{\mu,A_0}$ is the $\sup$ norm on $A_0$). Therefore \begin{aligned} \mu(\{|f_n-f|>\delta\}\cap A\big)\leq \mu(A\setminus A_0)<\varepsilon, \qquad (n\geq N). \end{aligned}