It sounds like you are asking whether thinking about someone constantly, dating people who look like them, dressing up, punishing yourself, and fantasizing is an obsession. You also seem confused as to how to cope with your situation, especially since he is your teacher.
First of all, as you may know, there are legal aspects to this situation. If you were to begin any sort of relationship with your teacher, he would be in danger from the law because he is in a position of authority with respect to you; however, you do not mention the desire to start a relationship with him or any sort of advances on his part.
Often attraction to people who are older and in some position of authority is called infatuation. You constantly think about the person, fantasize about them, and look forward to seeing them. These are perfectly normal reactions, and as long as they do not interfere with your school work, there is no reason to worry.
Dating a man his age that looks like him, however, is a less healthy option. Relationships require a bond of trust and attraction to work; however, that bond has to be based on the person, not on the person they look like. It seems highly unlikely that a stable, healthy relationship could come out of dating someone who looks like a person you are attracted to.
Punishing yourself by not eating is also not a healthy reaction to infatuation. Any person you have a relationship with should value you for who you are, and it is always most important to dress up (if you choose to do so) for yourself rather than for someone else.
I would recommend discussing your feelings for your teacher with a school counselor or another trusted adult who may be able to give you further advice based on the particulars of your situation. Don’t hesitate to write back if you have more questions…
Lauren, for AlterHeros