Given: 'X can be all numbers, except 2'.
I would write: 'x can be all numbers except x=2.'
But my teacher writes: 'x can be all numbers except x$\displaystyle \neq$2'
Thoughts?
Your teacher's sentence doesn't make sense grammatically. I agree with yours. Other ways to write it include $\displaystyle \displaystyle \begin{align*} x \in \mathbf{R} \backslash \{ 2 \} \end{align*}$ or $\displaystyle \displaystyle \begin{align*} x \in (-\infty, 2) \cup (2, \infty) \end{align*}$.