It is not necessary to use series or Sherman-Morrison Formula.
$M=I_n+\alpha^T\beta$
where $\alpha=(a_1,a_2,\ldots,a_n)$, $\beta=(b_1,b_2,\ldots,b_n)$ and $I_n$ is the identity matrix of order $n.\;$ Moreover, $\;1+\beta\alpha^T\ne0$.
We are looking for a matrix $N$ such that $MN=NM=I_n$.
$MN=I_n\iff\left(I_n+\alpha^T\beta\right)N=I_n\iff\\\iff N+\alpha^T\beta N=I_n\quad\color{blue}{(*)}$
and, by multiplying both sides of the last equality $(*)$ by the matrix $\;\alpha^T\beta\;,\;$ we get that
$\alpha^T\beta N+\alpha^T\left(\beta\alpha^T\right)\beta N=\alpha^T\beta\;,$
but $\;\beta\alpha^T$ is a number, hence it commutes with respect to multiplication,
$\alpha^T\beta N+\left(\beta\alpha^T\right)\alpha^T\beta N=\alpha^T\beta\;,$
$\left(1+\beta\alpha^T\right)\alpha^T\beta N=\alpha^T\beta\;.\quad\color{blue}{(**)}$
Since $\;1+\beta\alpha^T\ne0\;$, by dividing both sides of the last equality $(**)$ by the number $\;1+\beta\alpha^T$, we get that
$\alpha^T\beta N=\cfrac{1}{1+\beta\alpha^T}\alpha^T\beta $
and from $(*)$ it follows that
$N=I_n-\cfrac{1}{1+\beta\alpha^T}\alpha^T\beta\;.$
Moreover it is easy to verify that not only $MN=I_n$ but also $NM=I_n$, hence the matrix
$N=I_n-\cfrac{1}{1+\beta\alpha^T}\alpha^T\beta$
is the inverse of $\;M\;.$
_____________________________________
If $\;1+\beta\alpha^T=0\;$ then the matrix $M$ is not invertible.
Indeed, if $M$ were invertible, there would exist a matrix $N$ such that $MN=I_n$ and from $(**)$ it would follow that $\alpha^T\beta=0$ (zero matrix).
But $\;\alpha^T\beta=0\;$ implies that $\;\alpha\;$ or $\;\beta\;$ is the zero vector, hence $\;\beta\alpha^T=0\;$ and it contradicts the hypothesis $\;1+\beta\alpha^T=0.\;$ Consequently the matrix $M$ cannot be invertible otherwise it would lead to a contradiction.