Let $p(z)$ be a (not necessarily irreducible) polynomial in $\mathbb{Q}[z]$. Is there a built-in function I can use for determining the minimal polynomial of an element $\overline{q(z)} \in \mathbb{Q}[z]/(p(z))$, i.e. finding the smallest degree nonzero monic polynomial $Q(z) \in \mathbb{Q}[z]$ for which $p(z) ~|~ Q(q(z))$?
MinimalPolynomial
works, but only when $p(z)$ is irreducible and thus $\mathbb{Q}[z] / (p(z))$ determines a bona fide algebraic number field.