[proofplan]
We recast the divisor-sum hypothesis as an identity for Dirichlet convolution. The central algebraic fact is that the Möbius function is the convolution inverse of the constant-one arithmetic function. After proving this inverse identity directly from the definition of $\mu$, associativity of the finite divisor sums gives $\mu * g = f$, and evaluating that identity at $n$ gives the inversion formula.
[/proofplan]
[step:Define Dirichlet convolution and rewrite the hypothesis]
Let $\mathbf{1}: \mathbb{N} \to \mathbb{C}$ denote the constant arithmetic function given by $\mathbf{1}(n)=1$ for every $n \in \mathbb{N}$. For arithmetic functions $a,b: \mathbb{N} \to \mathbb{C}$, define their Dirichlet convolution $a*b: \mathbb{N} \to \mathbb{C}$ by
\begin{align*}
(a*b)(n)=\sum_{d\mid n} a(d)b(n/d).
\end{align*}
Then the hypothesis says exactly that
\begin{align*}
g(n)=\sum_{d\mid n} f(d)\mathbf{1}(n/d)=(f*\mathbf{1})(n)
\end{align*}
for every $n \in \mathbb{N}$. Hence $g=f*\mathbf{1}$ as arithmetic functions.
[guided]
The point of introducing Dirichlet convolution is to turn the divisor-sum formula into an algebraic product. Define the arithmetic function
\begin{align*}
\mathbf{1}: \mathbb{N} &\to \mathbb{C} \\
n &\mapsto 1.
\end{align*}
For arithmetic functions $a,b: \mathbb{N} \to \mathbb{C}$, their Dirichlet convolution is the arithmetic function
\begin{align*}
a*b: \mathbb{N} &\to \mathbb{C} \\
n &\mapsto \sum_{d\mid n} a(d)b(n/d).
\end{align*}
The sum is finite because every positive integer has only finitely many positive divisors.
Applying this definition with $a=f$ and $b=\mathbf{1}$ gives, for every $n \in \mathbb{N}$,
\begin{align*}
(f*\mathbf{1})(n)
&=\sum_{d\mid n} f(d)\mathbf{1}(n/d) \\
&=\sum_{d\mid n} f(d).
\end{align*}
By the hypothesis, the final expression is $g(n)$. Thus $g(n)=(f*\mathbf{1})(n)$ for every $n \in \mathbb{N}$, which is the function identity $g=f*\mathbf{1}$.
[/guided]
[/step]
[step:Prove that the Möbius function inverts the constant-one function]
Let $\varepsilon: \mathbb{N} \to \mathbb{C}$ denote the identity arithmetic function for Dirichlet convolution, defined by
\begin{align*}
\varepsilon(n)=
\begin{cases}
1, & n=1,\\
0, & n>1.
\end{cases}
\end{align*}
We claim that
\begin{align*}
\mu * \mathbf{1}=\varepsilon.
\end{align*}
Indeed, for $n=1$,
\begin{align*}
(\mu*\mathbf{1})(1)=\mu(1)\mathbf{1}(1)=1.
\end{align*}
If $n>1$, let $p_1,\dots,p_k$ be the distinct prime divisors of $n$, so $k\geq 1$. Since $\mu(d)=0$ unless $d$ is squarefree, only the squarefree divisors of $n$ contribute. These are exactly the products $\prod_{i\in S}p_i$ indexed by subsets $S\subseteq\{1,\dots,k\}$, and for such a divisor $\mu(\prod_{i\in S}p_i)=(-1)^{|S|}$. Therefore
\begin{align*}
(\mu*\mathbf{1})(n)
&=\sum_{d\mid n}\mu(d) \\
&=\sum_{S\subseteq\{1,\dots,k\}}(-1)^{|S|} \\
&=(1-1)^k \\
&=0.
\end{align*}
Thus $(\mu*\mathbf{1})(n)=\varepsilon(n)$ for every $n \in \mathbb{N}$.
[guided]
We need the fact that $\mu$ cancels the constant-one function under Dirichlet convolution. Define
\begin{align*}
\varepsilon: \mathbb{N} &\to \mathbb{C} \\
n &\mapsto
\begin{cases}
1, & n=1,\\
0, & n>1.
\end{cases}
\end{align*}
This is the identity arithmetic function for Dirichlet convolution.
We now prove $\mu*\mathbf{1}=\varepsilon$ by evaluating both sides at an arbitrary $n \in \mathbb{N}$. If $n=1$, then the only divisor of $1$ is $1$, and the defining value $\mu(1)=1$ gives
\begin{align*}
(\mu*\mathbf{1})(1)
&=\sum_{d\mid 1}\mu(d)\mathbf{1}(1/d) \\
&=\mu(1)\mathbf{1}(1) \\
&=1.
\end{align*}
This equals $\varepsilon(1)$.
Now suppose $n>1$. Let $p_1,\dots,p_k$ be the distinct prime divisors of $n$. Since $n>1$, we have $k\geq 1$. By the definition of the Möbius function, $\mu(d)=0$ whenever $d$ is divisible by the square of a prime. Hence, in the divisor sum
\begin{align*}
(\mu*\mathbf{1})(n)=\sum_{d\mid n}\mu(d),
\end{align*}
only squarefree divisors $d$ contribute. The squarefree divisors of $n$ are precisely the products
\begin{align*}
\prod_{i\in S}p_i
\end{align*}
where $S$ ranges over all subsets of $\{1,\dots,k\}$. For such a divisor, the definition of $\mu$ gives
\begin{align*}
\mu\left(\prod_{i\in S}p_i\right)=(-1)^{|S|}.
\end{align*}
Therefore
\begin{align*}
(\mu*\mathbf{1})(n)
&=\sum_{S\subseteq\{1,\dots,k\}}(-1)^{|S|} \\
&=\sum_{j=0}^{k}\binom{k}{j}(-1)^j \\
&=(1-1)^k \\
&=0.
\end{align*}
This equals $\varepsilon(n)$ for every $n>1$. Combining the cases $n=1$ and $n>1$ proves $\mu*\mathbf{1}=\varepsilon$.
[/guided]
[/step]
[step:Use associativity to isolate $f$]
We first record the associativity computation for Dirichlet convolution. For arithmetic functions $a,b,c: \mathbb{N}\to\mathbb{C}$ and $n\in\mathbb{N}$,
\begin{align*}
((a*b)*c)(n)
&=\sum_{e\mid n}\left(\sum_{d\mid e}a(d)b(e/d)\right)c(n/e) \\
&=\sum_{\substack{d,m,r\in\mathbb{N}\\ dmr=n}}a(d)b(m)c(r) \\
&=\sum_{d\mid n}a(d)\left(\sum_{m\mid n/d}b(m)c((n/d)/m)\right) \\
&=(a*(b*c))(n).
\end{align*}
All sums are finite divisor sums, so the rearrangement is valid.
Using $g=f*\mathbf{1}$, associativity, and $\mu*\mathbf{1}=\varepsilon$, we obtain
\begin{align*}
\mu*g
&=\mu*(f*\mathbf{1}) \\
&=(\mu*\mathbf{1})*f \\
&=\varepsilon*f.
\end{align*}
Finally, for every $n\in\mathbb{N}$,
\begin{align*}
(\varepsilon*f)(n)
&=\sum_{d\mid n}\varepsilon(d)f(n/d) \\
&=\varepsilon(1)f(n) \\
&=f(n),
\end{align*}
because $\varepsilon(d)=0$ for every divisor $d>1$. Hence $\mu*g=f$.
[guided]
We now use the algebraic structure of Dirichlet convolution. First, we verify associativity directly because the proof depends on changing the grouping of a triple convolution.
Let $a,b,c: \mathbb{N}\to\mathbb{C}$ be arithmetic functions. For each $n\in\mathbb{N}$, the definition of convolution gives
\begin{align*}
((a*b)*c)(n)
&=\sum_{e\mid n}(a*b)(e)c(n/e) \\
&=\sum_{e\mid n}\left(\sum_{d\mid e}a(d)b(e/d)\right)c(n/e).
\end{align*}
In the inner sum, write $m=e/d$ and write $r=n/e$. Then $d,m,r\in\mathbb{N}$ and $dmr=n$. Conversely, every factorization $dmr=n$ determines $e=dm$, with $e\mid n$ and $d\mid e$. Therefore
\begin{align*}
((a*b)*c)(n)
&=\sum_{\substack{d,m,r\in\mathbb{N}\\ dmr=n}}a(d)b(m)c(r).
\end{align*}
Since this is a finite sum over factorizations of $n$, we may regroup it by first choosing $d\mid n$ and then choosing $m\mid n/d$:
\begin{align*}
\sum_{\substack{d,m,r\in\mathbb{N}\\ dmr=n}}a(d)b(m)c(r)
&=\sum_{d\mid n}a(d)\left(\sum_{m\mid n/d}b(m)c((n/d)/m)\right) \\
&=(a*(b*c))(n).
\end{align*}
Thus Dirichlet convolution is associative.
Now we apply this associativity to the identity $g=f*\mathbf{1}$. Convolving both sides on the left by $\mu$ gives
\begin{align*}
\mu*g=\mu*(f*\mathbf{1}).
\end{align*}
By associativity and commutativity of the displayed finite divisor sums, we may group the right-hand side as
\begin{align*}
\mu*(f*\mathbf{1})=(\mu*\mathbf{1})*f.
\end{align*}
The previous step proved $\mu*\mathbf{1}=\varepsilon$, so
\begin{align*}
\mu*g=\varepsilon*f.
\end{align*}
It remains to check that $\varepsilon$ really acts as an identity. For every $n\in\mathbb{N}$,
\begin{align*}
(\varepsilon*f)(n)
&=\sum_{d\mid n}\varepsilon(d)f(n/d).
\end{align*}
The only divisor $d$ with $\varepsilon(d)\neq 0$ is $d=1$, and $\varepsilon(1)=1$. Hence
\begin{align*}
(\varepsilon*f)(n)=f(n).
\end{align*}
Therefore $\mu*g=f$ as arithmetic functions.
[/guided]
[/step]
[step:Evaluate the convolution identity to obtain the inversion formula]
Since $\mu*g=f$, evaluating at an arbitrary $n\in\mathbb{N}$ gives
\begin{align*}
f(n)
&=(\mu*g)(n) \\
&=\sum_{d\mid n}\mu(d)g(n/d).
\end{align*}
This is the desired Möbius inversion formula for every $n\in\mathbb{N}$.
[/step]