Notice that we can express integer division in terms of vanilla-flavoured division using the floor function. For example, your function $f$ could be expressed
$$f(a,b)=\left\lfloor\frac{a+b-1}{b}\right\rfloor=\left\lfloor\frac{a-1}{b}+1\right\rfloor=\left\lfloor\frac{a-1}{b}\right\rfloor+1$$
and $g$ could be expressed
$$g(a,b)=\left\{\begin{array}{ll}
\displaystyle\left\lfloor\frac a b\right\rfloor,&\left(\exists k\in \mathbb Z\right)\left(a=kb\right)\\
\displaystyle\left\lfloor\frac{a}{b}\right\rfloor+1,&\text{otherwise}
\end{array}\right.$$
Before we see why $f$ and $g$ are equivalent it might help to notice the following:
If $a$ can be expressed as $kb+r$ where $k\ge 0$ and $0\le r<b$ then $$\left\lfloor\frac{a}{b}\right\rfloor=\left\lfloor\frac{kb+r}{b}\right\rfloor=k+\left\lfloor\frac r b\right\rfloor=k$$
We can "complete the remainder" to get the identity:$$\left\lfloor\frac a b\right\rfloor = \left\lfloor\frac{kb+r\color{darkorange}{+(b-r)}}{b}\right\rfloor-1=k$$
(For example, if $a=28$ and $b=5$ so that $k=5$ and $r=3$. Notice that $\left\lfloor\frac {28} 5\right\rfloor=5$ and that $\left\lfloor\frac {28\color{darkorange}{+2}} 5\right\rfloor-1=5$.)
Now, if we consider the cases in $g$ separately:
Case 1: $a$ is a multiple of $b$
$$\begin{align}
\left\lfloor\frac{a-1}{b}\right\rfloor+1
&=\left(\left\lfloor\frac{a-1\color{darkorange}{+1}}{b}\right\rfloor-1\right)+1\\\\
&=\left\lfloor\frac a b\right\rfloor
\end{align}$$
Case 2: otherwise
In this case there exist unique $k\ge 0$ and $0<r<b$ such that $a=kb+r$, so
$$\begin{align}
\left\lfloor\frac{a-1}{b}\right\rfloor+1
&=\left(\left\lfloor\frac{kb+r-1+\color{darkorange}{(b-r + 1)}}{b}\right\rfloor-1\right)+1\\\\
&=\left\lfloor \frac{b(k+1)}{b}\right\rfloor\\\\
&=\left\lfloor k+1\right\rfloor\\\\
&=\left\lfloor\frac ab\right\rfloor+1
\end{align}$$