How are Lacan's essays "The Agency of the Letter in the Unconscious" and "The Mirror Stage as Formative of the I-Function" comparable to Derridean ideas?
This is a very large topic. In this limited answering format, you can get only a limited answer. Lacan's principle that signified and signifier are, at a primordial level, separated by a "barrier" that cannot be signified accords with Derrida's concept of play between signifiers.
The thematics of this science is henceforth suspended, in effect, at the primordial position of the signifier and signified as being distinct orders separated initially by a barrier resisting signification. (Lacan, "The Agency of the Letter in the Unconscious")
Derrida's principle of play suggests that signifiers are without connection to truth because truth encompasses both presence of meaning and absence of meaning. Nonetheless, because of the limitlessness of play, signifiers and signification are infinitely connected to truths below the surface of language's agreements. Lacan's and Derrida's principles are compatible because of Lacan's acknowledgement of the unidentifiable something that is a barrier to true signification at the primordial level of signification.
Derrida acknowledges that even though play is critical in signification, carried to extreme, identity of signification is driven "outside itself":
we cannot do without the concept of the sign, we cannot give up this metaphysical complicity without also giving up the critique we are directing against this complicity, without the risk of erasing difference [altogether] in the self-identity of a signified reducing into itself its signifier, or, what amounts to the same thing, simply expelling it outside itself. (Derrida, "Structure, Sign, and Play in the Discourse of the Human Sciences.")
This accords with Lacan's ideas about the I, also called the ideal-I ("The Mirror Stage as Formative of the I-Function") that he recognizes as being a primordial component of his infans and mirroring stages. Both men acknowledge there is a point below which reasoning cannot go without becoming an absurdity as reasoning negates, or seeks to negate, the reasoners themselves.