I am asking this question out of sheer curiosity. Ludwig van Beethoven was deaf but still made some amazing songs. Just like Beethoven, do your ears have to work normally (Like not deaf), to be able to compose good music?
You must have a perception of pitch, either relative or absolute, to make anything other people would consider to be music.
Beethoven was not born deaf. He had a very very solid knowledge of what he was doing before his hearing went. [I'm not going to even debate whether he went absolutely, totally deaf, it's not actually relevant].
Once you have the grounding of knowing absolutely what an instrument, playing notes written on a page sound like, that ability will remain with you.
I have an anecdotal tale of a friend listening to a poor performance by a choir of an unknown piece which he'd been handed the score for - at one point he exclaimed, "I can either read this or listen to it. I cannot do both at once!" & left the building to better be able to 'hear' in his own head what the composer, as opposed to the miserable choir, had intended it to sound like.
I think there are two things to unpack here: first what you mean by "music" and second what you mean by "hear."
When it comes down to it, anyone—almost anything—can compose music. We can automate a machine to hit a random piano key every x seconds; depending on your definition of "music," this may prove that you do not need the ability to hear to compose. I'm guessing you really mean to ask if someone can compose good music. But ultimately that's a subjective decision—what's good to you isn't necessarily good to everyone—so that's an impossible question to answer.
But more importantly, let's clarify that hearing isn't just limited to hearing outside sources; one can hear inside their heads to know what they're composing. A trained musician can look at a score and know what that score sounds like without making any external sounds; we call this audiation. With this skill in mind, I can certainly imagine a deaf individual being able to compose good music.
(Two caveats about this answer: first, note that I'm skipping over the fact that Beethoven used some sound-conduction techniques to hear some of the things he was writing. Second, my hypothetical deaf person is presumably one that lost the hearing that they once had; I'm not sure how or whether individuals born deaf are able to audiate.)
No, but it somewhat depends on how you define "composition" and "good." A common everyday example is when students are taught voice-leading rules in a university theory class and take a test on them, where it is unlikely they will have access to a piano for the exam (or at least, that was my experience, where we were to complete a chorale by filling in notes, purely by voice leading rules). A more poignant example is John Cage, who would roughly define a composition as whatever sounds happen between two points in time -- the driving idea behind his (in)famous composition 4'33". Composers such as Milton Babbit, Karlheinz Stockhausen, Pierre Boulez and other serial music composers wrote music that was based heavily on mathematical ideas of relationships as opposed to traditional consonance-and-dissonance, tonal, or modal relations. This music could be written out entirely before it was even played, as it was based on ideas other than what the ears hear. It's also important to note that there are people out there who love this kind of music, myself being partial to Stravinsky's take on serialism. (Obviously this compositional technique and others like it are open to criticism, but that's outside the point here.) Even then, as you pointed out, Beethoven could hear everything in his head after he had lost his hearing, although critics of his later work (e.g. the Große Fuge) argued that his deafness meant he couldn't clearly hear dissonance. He was presumably relying on his genius intuition, his mind's ear, and massive intellect to make choices about what to write -- the same kind of intuition being what many amateurs rely on to make choices on what to write. But all this and more doesn't preclude the use of rules as guides (or requirements) on what to compose or how to compose.