In class I learnt that to sketch $y=f(a-x)$ given a graph of $y=f(x)$, you reflect the given graph about the line $x=a/2$ (this was proven to us).
And then the teacher said that something we shouldn't do was sketch $y=f(x)\rightarrow y=f(-x)\rightarrow y=f(-x+a)$ which is equivalent to $y=f(a-x)$
And then he showed us how it was wrong with $y=x^2\rightarrow y=(2-x)^2$ as an example (the graph turned out to resemble $y=(x+2)^2$.
Can anyone explain why this mistake happened? The 'sequence' seemed so logical but I don't know where the error comes from.
The second way to sketch the function is also correct (if done correctly). What your teacher probably meant was that shifting $f(-x)$ by adding a constant $a$ giving $f(-x+a)$ corresponds to a shift in the opposite direction as doing 'the same' with $f(x)$, i.e. $f(x+a)$. If $a$ is positive, $f(-x+a)$ is obtained by shifting $f(-x)$ to the right, whereas $f(x+a)$ is obtained by shifting $f(x)$ to the left. This whole confusion can be avoided by writing $f(-x+a)$ as $f(-(x-a))$, then the shift occurs in the same direction as a shift $f(x-a)$.