Dirichlet inverse of $(-1)^n$ I was tinkering around and noticed the Dirichlet inverse of $\,f(n) = (-1)^n$ seems to be $$ f^{-1}(n) = -\mu\!\left(n\,/\,2^{\nu_2(n)}\right)\left\lceil 2^{\nu_2(n)-1} \right\rceil, $$
where $\nu_p(n)$ is the number of times a prime $p$ divides $n$.
Is there a way to derive or prove this? I don't see where I would begin.

Here's the Mathematica code I used to come up with my conjecture:
DirichletInverseTable[f_, n_?Positive] :=
  Block[{invs = ConstantArray[0, n]},
    invs[[1]] = 1/f[1];
    Do[invs[[k]] = -1/f[1]Sum[f[k/d]invs[[d]], {d, Most[Divisors[k]]}], {k, 2, n}];
    invs
  ]

f[n_] := (-1)^n

DirichletInverseTable[f, 30]


{-1, -1, 1, -2, 1, 1, 1, -4, 0, 1, 1, 2, 1, 1, -1, -8, 1, 0, 
  1, 2, -1, 1, 1, 4, 0, 1, 0, 2, 1, -1}


g[n_] := -MoebiusMu[n/2^IntegerExponent[n, 2]] Ceiling[2^(IntegerExponent[n, 2] - 1)]

(* test the conjecture *)
DirichletInverseTable[f, 10000] == Table[g[n], {n, 10000}]


True


 A: Let $f(n)=(-1)^n$, and $g(n)=-\mu\!\left(\frac{n\,}{\,2^{\nu_2(n)}}\right)\left\lceil 2^{\nu_2(n)-1} \right\rceil$.  Furthermore, take the previous answer's advice, and set $n=2^km$ for odd $m$.  Then their Dirichlet convolution satisfies
$$(f*g)(n)=(f*g)(2^k)\cdot(f*g)(m)$$
First we will show that $(f*g)(1)=1$ and $(f*g)(m)=0$ for $m>1$.  We have 
$$\begin{align} (f*g)(m)&=\sum_{d|m} f(m/d)g(d) \\
&=\sum_{d|m}(-1)^{m/d}(-1)\mu\!\left(d\,/\,2^{\nu_2(d)}\right)\left\lceil 2^{\nu_2(d)-1} \right\rceil \\ 
&=\sum_{d|m}\mu(d)\left\lceil 2^{0-1} \right\rceil\text{ (note that $m/d$ is odd and $\nu(d)=0$)} \\ 
&=\sum_{d|m}\mu(d)\end{align}$$
which is $1$ for $m=1$ and $0$ for $m>1$.  
We will now prove $(f*g)(2^k)=1$ for $k=0$ and $(f*g)(2^k)=0$ for $k>0$.  
If $k=0$, then 
$$\begin{align} &=\sum_{d|2^k}(-1)^{2^k/d}(-1)\mu\!\left(d\,/\,2^{\nu_2(d)}\right)\left\lceil 2^{\nu_2(d)-1} \right\rceil \\ 
&=(-1)^{1/1}(-1)\mu\!\left(1\,/\,1\right)\left\lceil \frac12 \right\rceil \\
&=1\end{align}$$
And finally, if $k>0$, then
$$\begin{align} &=\sum_{d|2^k}(-1)^{2^k/d}(-1)\mu\!\left(d\,/\,2^{\nu_2(d)}\right)\left\lceil 2^{\nu_2(d)-1} \right\rceil \\
&= \sum_{i=0}^k(-1)^{2^{k-i}}(-1)\mu\!\left(1\right)\left\lceil 2^{i-1} \right\rceil \\
&=-(-1)^{2^k}+2^{k-1}-\sum_{i=1}^{k-1}2^{i-1} \\
&=-1+2^{k-1}-2^{k-1}+1 \\
&=0\end{align}$$
Since the function $$e(n)=\begin{cases}1,\text{ for $n=1$} \\
0,\text{ for $n>1$} \end{cases}$$
is the identity of Dirichlet convolution, we know $$f*g=e$$ so $g$ is the inverse of $f$.  

To see how this formula is derived, we must utilize the explicit construction of an inverse function.  Namely, an arithmetic function $f(n)$ has a Dirichlet inverse if and only if $f(1)\neq 0$.  You can see this by recursively defining the inverse of $f$, say $g(n)$, by $$g(1)=1/f(1)$$ and $$g(n)=(-1/f(1))\sum_{d|n, d<n} f(n/d)g(d)$$
From this, you can directly prove $g(2^{k+1})=-2^k$ for all $k\geq 0$ by induction (weak is fine).  Furthermore, you can then prove $g(m)=-\mu(m)$ for all odd $m>1$, again by induction (strong is probably better).  
Lastly, one need only prove for even $n$ that is not a power of $2$, $g(n)=-g(2^{\nu_2(n)})g(n/2^{\nu_2(n)})$.  Your formula directly follows from this.  
A: Yes, your conjecture is true.
To prove this, note that all divisors of $n$ are of the form $2^kd$ where $d$ is an odd divisor.
Compute the sum that is equivalent to your original one: 
$$\sum_{\substack{d|n, \\ d\, \text{odd}}}\sum_{i=1}^{v_2(n)}(-1)^{2^{v_2(n)-i}}(-\mu(d))\left \lceil 2^{i-1} \right \rceil$$
Note that if $n$ is even, then all terms in the second sum cancel by geometric series formula. In the odd case, it is simply equal to $\mu(d)$, and it is well-known that $\mu$ is the Dirichlet inverse of $1$.
