Histone demethylase that demethylates both 'Lys-4' (H3K4me) and 'Lys-9' (H3K9me) of histone H3, thereby acting as a coactivator or a corepressor, depending on the context. Acts by oxidizing the substrate by FAD to generate the corresponding imine that is subsequently hydrolyzed. Acts as a corepressor by mediating demethylation of H3K4me, a specific tag for epigenetic transcriptional activation. Demethylates both mono- (H3K4me1) and di-methylated (H3K4me2) H3K4me. May play a role in the repression of neuronal genes. Alone, it is unable to demethylate H3K4me on nucleosomes and requires the presence of RCOR1/CoREST to achieve such activity. Also acts as a coactivator of androgen receptor (ANDR)-dependent transcription, by being recruited to ANDR target genes and mediating demethylation of H3K9me, a specific tag for epigenetic transcriptional repression.