While reading Tate's article on Finite Flat Group Schemes in "Modular Forms and Fermat's Last Theorem" I was lead to this question. Let $S$ be a scheme, $G$ a group scheme over $S$, and $T$ an $S$-scheme. The character group scheme of $G$ (denoted $G^{\prime}$) is the functor, $$T\mapsto Hom_{(Gr/T)}(G_T,(\mathbb{G}_m)_T)$$ from the category of $S$-schemes to that of Abelian Groups. By "$Hom_{(Gr/T)}(G_T,(\mathbb{G}_m)_T)$" I mean the hom set in the category of group schemes over $T$.

**Question:** Suppose that $G$ and $S$ are affine. What additional conditions do I need in order to ensure that $G^{\prime}$ is representable?

**What I have so far:** Let $G=Spec(A),S=Spec(R),T=Spec(B)$, where $A$ is a commutative, unital Hopf $R$-algebra, and $B$ is an $R$-algebra. I know that there is a $$G^{\prime}(T)=Hom_{(Gr/T)}(G_T,(\mathbb{G}_M)_T)\xrightarrow{natural}Hom_{(Gr)}(G(T),\mathbb{G}_m(T)),$$ given as follows: A given $\phi\in G^{\prime}(T)$ induces the group homomorphism that takes each $g\in G(T)$ to $$T\xrightarrow{g_T}G_T\xrightarrow{\phi}(\mathbb{G}_M)_T\xrightarrow{projection}\mathbb{G}_m.$$

I also know that $G^{\prime}(T)$ consists of the group-like elements of $A\otimes_RB$. That is, units, $u$, such that $m_B(u)=\Delta(u)$, where $m_B:A\otimes_RB\rightarrow (A\otimes_RB)\otimes_B(A\otimes_RB)$ is the comultiplication and $\Delta$ is the codiagonal ($u\mapsto u\otimes u$).

I've played around with taking the kernel of $m_B-\Delta$, since it is $B$-linear. I've tried using the adjunction between hom and tensor product. I've tried doodling around with Yoneda's Lemma. I expect that the representing object for $G^{\prime}$ should be some sort of fibered product of schemes, but I'm stuck in finding it. Oh, and I expect that $G^{\prime}$ is representable when $A$ is free over $R$, but I don't know how to show it, and I was hoping to weaken that hypothesis a little.

**From your comments:**

Look up Cartier Duality

I should expect trouble if $G$ is not commutative, or if I leave the finite flat case.