Translation:I understood the homework listening to the teacher.
Yes, in Romanian it is necessary.
In this construction "o" is a pronoun and a direct object. It refers to something else from the context. Here "o" refers to "învățătoare", and no other interpretations are possible.
Depending on the context "o" can refer to different things. Some examples:
Am înțeles tema ascultând-o (o = tema). | I understood the homework by listening to it (it = the homework). -- If there isn't any other context available then "o" can't refer to anything else.
Profesoara a citit tema. Am înțeles-o (o = tema) ascultând-o (o = pe profesoară). | The teacher read the homework. I understood it (it = the homework) by listening to her (her = the teacher).
Profesoara era tristă. Am înțeles-o (o = pe profesoară) ascultând-o (o = pe profesoară). | The teacher was sad. I understood her (her = the teacher) by listening to her (her = the teacher).
Tema era disponibilă în format text și în format audio. Am înțeles-o (o = tema) ascultând-o (o = tema). | The homework was available in both text and audio formats. I understood it (it = the homework) by listening to it (it = the homework).
Thank you. However I still don't understand why both o and pe are necessary in one sentence. In many of your example you show that the o replaces pe ____. You don't use both words in any of your examples. Can you help please? Or does pe mean 'by' in this context and if so why is by not in the English translation?
In the previous comment, I focused on "o", trying to evidentiate that 1) "o" makes reference to something else from the given context, and 2) that this something else changes depending on the context. That's why I gave the examples 2, 3 and 4 using the exact same sentence ("Am înțeles-o ascultând-o.") but with different meanings for "o".
Regarding "o" and "pe PRONOUN / NOUN / NUMERAL" in the same sentence, this is just the way it is in Romanian. It may seem redundant, but you have to get used to it.
In Romanian, there are two types of pronouns in both accusative and dative cases: the unstressed pronoun and the stressed pronoun. Let's take an example with the accusative case (because of our ''pe" preposition):
EU O VĂD PE EA. = I SEE HER. -- literally I her see her.
eu = pronoun and subject; it is optional; it can be deduced from the conjugated form of the verb
o = unstressed pronoun and direct object (accusative); it is mandatory in this construct
(pe) ea = stressed pronoun and direct object (accusative); it is optional; it emphasizes the fact that it is she whom I see
pe = preposition; it introduces the accusative case which answers to the Whom (do you see)? question (Pe cine (vezi)? Pe ea.)
văd = "a vedea" conjugated at first person singular ("eu")
CORRECT: (Eu) o văd (pe ea). = O văd. = Eu o văd. = O văd pe ea. = I see her.
All four are valid sentences and we use one or another depending on what we want to emphasize. Any of the optional elements (between the round parentheses) - or both at the same time - can be missing. "O văd." is a complete sentence that communicates the idea that I see her wholly. But if I want to emphasize that it is I who sees her, then I use one of the sentences that include "eu". Or if I want to emphasize that it is she whom I see, then I use one of the sentences that include the stressed pronoun "pe ea".
WRONG: Eu văd pe ea. / Văd pe ea. -- because the unstressed pronoun "o" is mandatory in this construct
Now if I say only "Eu o văd pe ea." and nothing else, then I won't know who "ea" is. I only know that "ea" refers to (emphasizes) "o". That's why I need to introduce the designated object somewhere, either in the same sentence or in another sentence from the context. So I use a sentence like:
EU O VĂD PE PROFESOARĂ. = I SEE THE TEACHER. -- literally I her see the teacher.
eu = same as above
o = same as above
(pe) profesoară = noun and direct object (accusative)
pe = same as above
văd = same as above
CORRECT: Eu o văd pe profesoară. = O văd pe profesoară. = I see the teacher.
WRONG: Eu văd pe profesoară. / Văd pe profesoară.
About EU VĂD PROFESOARA. = I SEE THE TEACHER.
If the noun is definite, the stressed pronoun "o" has to be missing.
Context: In the classroom there are a teacher and a student. Whom do you see (between the two)?
CORRECT: I see the teacher. = Eu văd profesoara. = Eu o văd pe profesoară.
WRONG: Eu o văd profesoara. / Eu văd profesoară.
However, if I recognize the French teacher, then:
CORRECT: Eu o văd pe profesoara de franceză. = I see the French teacher. / Eu văd o profesoară de franceză. = I see a French teacher.
WRONG: Eu văd pe profesoara de franceză. / Eu o văd profesoara de franceză. /// Eu o văd pe profesoară de franceză. / Eu o văd profesoară de franceză. +++
Pay attention to the switch between indefinite and definite articles (o profesoară - profesoara)!!!
Adding an attribute to "profesoară" requires the use of either the indefinite article ("o") or the definite article ("profesoara").
+++ Eu o văd profesoară de franceză. -- This last wrong example is actually a valid sentence but has a completely different meaning (see below +++).
About EU VĂD O PROFESOARĂ. = I SEE A TEACHER.
This is simple. Here "o" is the indefinite article, not the unstressed pronoun.
WRONG: Eu văd pe o profesoară.
AWKWARD (I would avoid): Eu o văd pe o profesoară. Instead, use: Eu văd o profesoară.
+++ About (ÎN VIITOR) EU O VĂD PROFESOARĂ (DE FRANCEZĂ).
This is a prediction: (IN THE FUTURE) I SEE HER A (FRENCH) TEACHER. -- I don't see a teacher right now because she is not one yet.
Please also see the following threads:
Help with accusative pronouns: https://www.duolingo.com/comment/25961226
Examples of scenarios using accusative pronouns: https://www.duolingo.com/comment/26336984
Dative Pronouns: https://www.duolingo.com/comment/19143960/Dative-Pronouns
Please see the Acuzativ and Dativ columns from the table in this wiki page (accentuat = stressed, neaccentuat = unstressed):
Mulțumesc :) Mă bucur că pot să ajut. Româna ta este aproape perfectă!
When revealing professions and other personal characteristics, the indefinite article is not usually used unless the noun is accompanied by an attributive adjective. So it's:
Ești profesoară? Sunt profesoară. Sunt o profesoară bună.
Ești băiat sau fată? Sunt băiat. Sunt un băiat înalt. -- Sunt un băiat. sounds like I'm some boy.
I'm not a teacher. I had good teachers in school, but it has passed enough time to forget a lot of the theory. So it's easier to provide examples rather than rules.