Let $G$ be a group, $k$ be a commutative unital ring.
Consider $\mathbf{Alg}_k^{inv}$ the category of unital $k$-algebras whose multiplicative semigroup is a group. Then there is a forgetful functor $$U:\mathbf{Alg}_k^{inv}\to \mathbf{Grp}$$ that assigns each algebra its multiplicative group. This functor has a right adjoint $$K:\mathbf{Grp}\to \mathbf{Alg}_k^{inv}$$ which assigns to each group its group algebra. One can see this by observing that the group homomorphism $G\to U(k[G])$ is initial in the comma category $G\to U(\mathbf{Alg}_k^{inv})$ and thus is a unit.
There is something wrong with it, because a $k$-representation of a group is supposed to be equivalent to a $k[G]$-module. But now it is weird as it corresponds to an algebra morphism $k[G]\to Aut_k(V)$. Please help me point out what is the correct way to understand group algebra.
OK, I realized why this is wrong. But what is the right way to think about it? It the group algebra construction a left adjoint to some functor?
The group algebra is a functor $\mathsf{Grp} \to \mathsf{Alg}_K$ which is left adjoint to the "group of units" functor $\mathsf{Alg}_K \to \mathsf{Grp}$, $A \mapsto A^\times$. It is defined for all unital $K$-algebras. No non-trivial ring has the property that its underlying semigroup is a group, because $0$ is not invertible. If $V$ is some $K$-module, then a $K[G]$-module structure on $V$ (which restricts to the given $K$-module structure) corresponds to a $K$-algebra homomorphism $K[G] \to \mathrm{End}_K(V)$, hence (by adjunction) to a group homomorphism $G \to \mathrm{Aut}_K(V)$. So this is precisely a representation of $G$ on $V$.