Considering the terminologies:
$\qquad - \space$ Local minimum/maximum $\,\equiv\,$ Minima/Maxima.
$\qquad - \space$ Global minimum/maximum $\,\equiv\,$ Minimum/Maximum.
Let:
$$
f(x) = \begin{cases} f_{{\small1}}(x)=+2x+3 &\colon x<0 \\[2mm] f_{{\small2}}(x)=-3x+1 &\colon x=0 \\[2mm] f_{{\small2}}(x)=-3x+1 &\colon x>0 \end{cases}
\qquad
g(x) = \begin{cases} g_{{\small1}}(x)=-3x+1 &\colon x<0 \\[2mm] g_{{\small1}}(x)=-3x+1 &\colon x=0 \\[2mm] g_{{\small2}}(x)=+2x+3 &\colon x>0 \end{cases}
$$
Because $\,f_{{\small1}}(0)=3 \ne 1= f_{{\small2}}(0)\,\,\,$ and $\,\,\,g_{{\small1}}(0)=1 \ne 3= g_{{\small2}}(0)\,$,
both $f(x)$ and $g(x)$ have $\,\color{red}{{\small\text{discontinuity at}}\,x=0}$, and first derivative test is not applicable as is.
Nevertheless, we still can apply the theorem on each interval and treat $x=0$ as an endpoint.
For $f(x)$:
$$ \begin{cases} f'_{{\small1}}(x)=+2\,\,{\small\left\{\text{increasing}\right\}}\, &\colon\,x\in\,]-\infty,\,0[ \space\Rightarrow\quad\,f_{{\small1}}(0)=3\,\,{\small\text{is a Maximum}} \\[2mm] f'_{{\small2}}(x)=-3\,\,{\small\left\{\text{decreasing}\right\}}\, &\colon\,x\in\,]0,\,\,\,+\infty[ \space\Rightarrow\quad\,f_{{\small2}}(0)=1\,\,{\small\text{is a Maximum}} \end{cases} $$
Thus at $\left(x=0\right)$, $f(x)$ dos not have any minimum/minima, and may have a maximum if $f(0)=f_{{\small1}}(0)$. Unfortunately, $\,\left\{f(x)=f_{{\small2}}(x)\,\colon\,x=0\right\}\,$; Hence, $f(x)$ does not have any maximum/maxima at $x=0$.
For $g(x)$:
$$ \begin{cases} g'_{{\small1}}(x)=-3\,\,{\small\left\{\text{decreasing}\right\}}\, &\colon\,x\in\,]-\infty,\,0[ \space\Rightarrow\quad\,g_{{\small1}}(0)=1\,\,{\small\text{is a Minimum}} \\[2mm] g'_{{\small2}}(x)=+2\,\,{\small\left\{\text{increasing}\right\}}\, &\colon\,x\in\,]0,\,\,\,+\infty[ \space\Rightarrow\quad\,g_{{\small2}}(0)=3\,\,{\small\text{is a Minimum}} \end{cases} $$
Thus at $\left(x=0\right)$, $g(x)$ dos not have any maximum/maxima, and may have a minimum if $g(0)=g_{{\small1}}(0)$. Indeed, $\,\left\{g(x)=g_{{\small1}}(x)\,\colon\,x=0\right\}\,$. Hence, $g(x)$ does have minimum at $x=0$.
