A canonical module admits a somewhat less technical description than one often sees. I'll work in the local case for simplicity, noting that we can pass to the local case by localization. Let $(R,\mathfrak{m},k)$ be a Noetherian local ring of dimension $d$. A canonical (or dualizing) module $\omega_R$ for $R$ is an (all modules here are finitely generated) $R$-module satisfying the following:
- $\omega_R$ has finite injective dimension.
- $\dim_k\operatorname{Ext}^d_R(k,\omega_R)=1$
If a canonical module exists, it can be characterized by the following properties:
- $\omega_R$ has finite injective dimension.
- $\omega_R$ is maximal Cohen-Macaulay.
- $\omega_R$ is indecomposable.
Deep work of Peskine-Szpiro and Paul Roberts shows Bass' question has an affirmative answer; that is, a Noetherian local ring admitting a finitely generated (nonzero) module of finite injective dimension must be Cohen-Macaulay, so Cohen-Macaulayness is a necessary condition for existence of a canonical module.
The "spaces" of maximal Cohen-Macaulay (MCM) modules and those of finite injective dimension are "orthogonal" in the sense that $\operatorname{Ext}^i_R(M,Y)=0$ for all $i>0$ whenever $M$ is MCM and $Y$ has finite injective dimenson. A canonical module $\omega_R$ (should it exist) "spans" the intersection in that any module $N$ that is both MCM and has finite injective dimension must have $N \cong \omega_R^{\oplus n}$ for some $n$.
A canonical module gives a nice duality theory on Cohen-Macaulay (CM) $R$-modules: If $M$ is a Cohen-Macaulay module of dimension $t$, then:
- $\operatorname{Ext}^i_R(M,\omega_R)=0$ for $i \ne d-t$.
- $\operatorname{Ext}^{d-t}_R(M,\omega_R)$ is Cohen-Macaulay of dimension $t$.
- $\operatorname{Ext}^{d-t}_R(\operatorname{Ext}^{d-t}_R(M,\omega_R),\omega_R) \cong M$.
So, setting $(-)_t^{\vee}:=\operatorname{Ext}^{d-t}_R(-,\omega_R)$, gives a duality on CM modules of dimension $t$. In particular, $(-)_d^{\vee}=\operatorname{Hom}_R(-,\omega_R)$ gives a duality on MCM modules.
When $d=0$, we have $\omega_R \cong E(k)$ so canonical duality is just Matlis duality, but, despites it's usefulnesss, there are some pesky things about Matlis duality in higher dimension. For instance, Matlis duals of finitely generated modules are no longer finitely generated, and one needs to pass to the completion to get a true duality. Canonical duality has it's drawbacks (Cohen-Macaulayness is a necessary condition here) but can be more appropriate to work with in the right context.
As you said, one equivalent characterization of the Gorenstein condition is that $R$ is it's own canonical module. This means duality into $R$, i.e. $\operatorname{Hom}_R(-,R)$ for MCM modules, or $\operatorname{Ext}^{d-t}_R(-,R)$ for CM modules of dimension $t$, which can normally be ill-behaved, functions as a true duality. Furthermore, one can show a Noetherian local ring $R$ admits a canonical module if and only if $R$ is both Cohen-Macaulay and is the homomorphic image of a Gorenstein ring. In fact, if $R \cong S/I$ is Cohen-Macaulay and $S$ is Gorenstein, one can show $\omega_R \cong \operatorname{Ext}_S^{\dim S-\dim R}(R,S)$. In this manner, Gorenstein rings sort of build the foundation for canonical duality in general.