I'll consider that your question is two-fold, one relating to the relationship between Deleuze & Hegel, and secondly, the source of inspiration of Difference & Repetition.
With regard to the first question, Gilles Deleuze (1925-1995) had an educational formation steeped in the history of philosophy. From major to minor characters in the history of western thought, he would have been exposed to a very wide range, and expected to have speak on and defend theses most major figures. His first these, on Hume, was supervised by Hyppolite and Canguilhem, the former of whom I call out because in the comment below your question you express that the source of interest is largely in the connection between Deleuze & Hegel.
Hyppolite, is one of the three major sources of French interest in Hegel in the 20th century and Deleuze would have attended his seminars on him as he did every other philosopher covered by Hyppolite while at the Lycée Henri-IV. Deleuze wrote a very interesting review of Hyppolite's second book on Hegel, Logique et Existence in 1954, fourteen years before Difference & Repetition, where he calls out some limitations or issues in Hegel's approach to an ontology of difference as distinct from a phenomenology of difference, as framed by Hyppolite's thesis. The review however is not so much a critique of Hegel as an assessment and minor critique of Hyppolite's central thesis which sought to synthesize and extrapolate some consequences of reading Hegel's Logic, the Phenomenology, and the Encyclopaedia on the basis of the idea that Philosophy must be ontology, not of essence, but of "sense". Although very short, it does demonstrate a fairly strong understanding of Hegel and Hyppolite's take on him, and foreshadows somethings he could come back to related to ontology in 1969 in the book Logique du Sens.1
Another source of Deleuze's relationship to Hegel would have come from Jean Wahl, who was another source of Hegel studies in France during the post-War period. According to Francois Dosse, a biographer of Deleuze, Deleuze calls on Wahl's critical reading of Hegel in resituating the question of "empiricism" that becomes the focus of the Hume study.
In 1953, the work came out under the title Empiricism and
Subjectivity and was dedicated to Jean Hyppolite, Deleuze’s
former professor and the founder and director of Epiméthee,
the collection in which the book was published. It was wholly
out of step with current fashion: Hegel, who was on the 1946
aggregation program, had strongly denounced empiricism, as had
Husserl. Deleuze’s study drew heavily on Jean Wahl’s critical thesis against Hegelianism.2
It should be noted however that Hegel is never mentioned in his thesis on Hume, nor is Jean Wahl, so either Dosse's information came from people who knew why Deleuze took an interest in Hume as a thesis topic or it could simply be speculation.
Another thing I would add is the presence (and kinship) felt by Deleuze for Henri Bergson (I say kinship, but Deleuze never took him uncritically, he sifted through and kept what he found profound and dismissed a lot) who according to Dosse, took to Bergson in the late 1940's and later lectured on him in the 1950's and wrote a book on him in 1966. Deleuze deeply appreciated Bergson's Essais sur les élements principaux de la representation (written in 1889) which would have presented a major source of contention for Deleuze's reception of Hegel --who was unavoidable in those years of French universities--, insofar as it is utterly resistant to any form of dialectic.
There are Deleuze scholars that emphasize Nietzsche as a source of Deleuze's stance on Hegel, but the timeline of events doesn't match what occured, as Deleuze's active interest in Nietzsche doesn't begin until after Bergson, and much later than his rejection of forms of dialecticism and phenomenology in the 1950's.
With regard to Difference & Repetition, one has to contextualize the 1960's a lot more broadly. The 1950's and 60's saw the maturation of a revolution in both philosophy and the social & human sciences called "Structuralism". Deleuze attended lectures from many greats of that day that were all exploring the consequences of structuralism in their fields, the legacy of de Saussure in linguistics and semiotics (via Roland Barthes and Roman Jakobson), Jacques Lacan radically rewriting the legacy of Freud, Derrida exploring implication in philosophy, philosophy of language, and phenomenology, Foucault exploring its implications for rewriting the history of the present, Althusser rewriting the legacy of Marx, Machiavelli and politics. Deleuze, who up to that point, was known as someone who merely wrote on the history of philosophy, attended lectures from all of them, befriended many of them, and was extremely intrigued in where those developments were taking their respective fields. All of these characters influenced largely indirectly, what he lectured on, what he was engaged in, and ultimately the content of what actually appeared in Difference & Repetition. In fact, bits and pieces of the ideas that first appear in "A quoi reconnaît-on le structuralisme" (How does one Recognize Structuralism) are rewritten and developed more thoroughly in Difference & Repetition.
Now, two of the five essential points Deleuze recognizes as being common in these structuralist transformations are 1) the relationship between the differential and the singular; and 2) the nature of differentiation as a problematic of the unconscious. In a sense, Deleuze in Difference & Repetition uses common reference points in the developments of structuralism on the 1960's to draw out implications and to weave a web of explicating points for a "metaphysics of difference" that we first began to write about in his first essay on Bergson in 1956.
This 1956 text already contained the prolegomena of Deleuze’s future thesis of difference as absolute, and it drew its inspiration from Bergsonian positions. According to Deleuze, Bergson shifted the classical and unanswerable question of “why something rather than nothing” to “why this thing rather than that thing?” which leads to the question of difference and to a true metaphysics of difference. “Which is to say that being is difference and neither the immutable or the indifferent, or the contradiction, which is merely a false movement.”53 The possible exit from the aporia, which amounts to opposing in binary fashion the one and the many, is to valorize difference as difference. (Dosse 2010, p. 138)
The theme of a metaphysics of difference thus takes on a central importance for him from Bergson's influence that would be examined from a number of angles in the years (as evidenced from lectures on Plato, Aristotle, Leibniz, Kant, Maimon, Bergson, and finally Nietzsche) preceding 65-67 when preparing for his doctoral dissertation. However, the centrality of this same theme in the work of his peers (but perhaps in many ways that he felt were unclear, inconsistent or problematic) made it the perfect choice The desire to write this metaphysics in a clean way (without caveats for what he saw as Bergson's limitations, or exceptions to points made by previous "philosophers of difference" (as he called Aristotle, Leibniz, Hegel, Schelling, Heidegger), and directly addressing the history of philosophy without writing from one of their perspectives) one could say is the central impetus for it being chosen as his primary dissertation topic. His secondary thesis which was done on Spinoza already signals something that does not make explicit in Difference & Repetition, which was the extent to which he was already signaling his distancing from the structuralists he invoked for exemplary purposes in D&R (essentially his peers and others he'd maintained cordial learning relationships with) that the thesis of the univocity of being (introduced in his secondary thesis and developed in the book Logique du Sens in 1969) is ultimately incompatible with and undoes a central presupposition of structuralism. This isn't really made clear until Anti-Oedipus, when concepts sufficient to the problematic of becoming (developed fully in Logique du Sens) are developed. This last point is outside of the scope of your question but I did want to point this out as I'd above introduced the ambiance of structuralism as a factor for the focus on this topic.
Gilles Deleuze's review of Logique et existence was originally published in Revue philosophise de la Trance et I'etranger (1954): 144, 457-60. �1954 by Presses Universitaires de France, Paris.
François Dosse, (2010). Gilles Deleuze and Félix Guattari: Intersecting Lives. Columbia University Press. p. 111.