How do we know if a compound is amphoteric or not?
Sorry to tell you but your teacher's opinion is not right, just because the word "react" is not enough. Usually you label oxides as "amphoteric". You may say that if an oxide reacts with an acid and forms a salt or if an oxide reacts with a base forms a salt then you can say that it is an amphoteric oxide. Take the example of aluminum oxide, when dissolved in HCl it will form aluminium chloride, but we can also dissolve it in NaOH, where it forms sodium aluminate.

However, we can broaden this definition further (good for advanced classes). One formal definition is "A chemical species that behaves both as an acid and as a base is called amphoteric. This property depends upon the medium in which the species is investigated: H2SO4 is an acid when studied in water, but becomes amphoteric in superacids."

See: https://goldbook.iupac.org/html/A/A00306.html