Showing that an arithmetic function is multiplicative Let $f$ be an arithmetic function that counts the number of consecutive integers between $1$ and $n$ (inclusive) such that both integers are coprime to $n$. More formally,
$$ f(n) = \sum_{\substack{1 \leq t \leq n \\ (t,n)=1 \\ (t+1,n)=1}}1. $$
An immediate observation is that $f(n)=0$ when $n$ is even. After playing around with this function, I suspect that it is multiplicative. That is, if $(a,b)=1$, then $f(ab)=f(a)f(b)$. However, I am unable to prove this.
Is this function really multiplicative or are there counterexamples?
Also, what happens when we modify $f$ so that it counts the number of consecutive triplets that are all coprime to $n$?

Yes.
We can restrict to values $(a,b)$ such that $a,b>2$ are odd and coprime.
Now we use the following observations:

*

*$f(n)$ counts the number of points $(x,y)$ with coordinates in the ring $\Bbb Z/n$ such that
$$
\tag{$C(n)$}
x(x+1)y=1\ .
$$

*If $u,v$ are invertible modulo $n$, then we can use alternatively (set e.g. $x=ux'$, etc.)
$$
\tag{$C(n;u,v)$}
x(x+u)y=v\ .
$$

*$\Bbb Z/ab\cong (\Bbb Z/a)\times(\Bbb Z/b)$, $x\cong(x',x'')$ in the category of rings. (Chinese Remainder Theorem, CRT.)

*We need an explicit isomorphism. So we write $1=as+bt$ in $\Bbb Z/ab$, where $(a,b)=(s,b)=(t,a)=(s,t)=1$.

*The explicit ring isomorphism from the CRT is $(x',x'')\to x:=btx'+asx''$. (So $(1',1'')\to 1$.) The converse morphism is the canonical projection.

*Let $(x,y)$ be a solution modulo $ab$. Then with $x=btx'+asx''$ we have
$$
1=x(x+1)y=(btx'+asx'')(btx'+asx''+as+bt)y\ ,
$$
and reading this modulo $a$, respectively modulo $b$ we obtain solutions in $\Bbb Z/a$ and $\Bbb Z/b$ for the equations $C(a;1,1/(bt)^2=1)$ and $C(b; 1, 1/(as)^2=1)$.

*Conversely, let us start with a solution $(x', ?')$ modulo $a$, and a solution $(x'',?'')$ modulo $b$ for the equations above, the corresponding $x$ leads to a solution modulo $ab$.

$\square$

Note: Since for a prime $p$ we have $f(p^k)=(p-2)p^{k-1}$, we have in general for a number $N$ with prime factor decomposition
$$
N=p_1^{k_1}p_2^{k_2}\dots p_r^{k_r} 
$$
the formula
$$
f(N)
=N
\left(1-\frac 2{p_1}\right)
\left(1-\frac 2{p_2}\right)
\cdots
\left(1-\frac 2{p_r}\right)
\ .
$$
