Let $\begin{align*} Q_1&=\{(x,y)\in\mathbb{R}^2\mid x>0, y>0\}\\ Q_2&=\{(x,y)\in\mathbb{R}^2\mid x<0, y>0\}\\ Q_3&=\{(x,y)\in\mathbb{R}^2\mid x<0, y<0\}\\ Q_4&=\{(x,y)\in\mathbb{R}^2\mid x>0, y<0\} \end{align*}$ be the four open quadrants in the plane, and let $\begin{align*} A_x&=\{(x,y)\in\mathbb{R}^2\mid y=0\}\\ A_y&=\{(x,y)\in\mathbb{R}^2\mid x=0\} \end{align*}$ be the $x$- and $y$-axes, respectively. Then $f(x,y)=2$ if and only if $(x,y)\in Q_1\cup Q_2\cup Q_3\cup Q_4$ and $f(x,y)=1$ if and only if $(x,y)\in A_x\cup A_y.$ To provide a picture, $f(x,y)=2$ in the blue region, and $f(x,y)=1$ in the red region:
$\hskip1.6in$
By definition, the function $f$ is continuous at $(a,b)\in\mathbb{R}^2$ if and only if, for any open set $V\subseteq\mathbb{R}$ containing $f(a,b)$, there is an open set $U\subseteq\mathbb{R}^2$ containing $(x,y)$ such that $f(U)\subseteq V$.
Suppose $f(a,b)=1$. The set $V=(\frac{1}{2},\frac{3}{2})$ is an open subset of $\mathbb{R}$ containing $1$. Because $f$ only takes the values $1$ and $2$, the only way to have $f(x,y)\in V$ is to have $f(x,y)=1$. Thus, the only way to have $f(U)\subseteq V$ is if $f(x,y)=1$ for every $(x,y)\in U$, or in other words, $U\subseteq A_x\cup A_y$. Are there any non-empty subsets $U\subseteq A_x\cup A_y$ that are open as subsets of $\mathbb{R}^2$? What does that tell you about whether it's possible for $f$ to be continuous at any point in $A_x\cup A_y$ (the red region)?
Now do the same analysis but for when $f(a,b)=2$. You could let $V=(\frac{3}{2},\frac{5}{2})$, for example.