For each $n\in \mathbb{N}$ define:
$B_n := \{(x,y) \in \mathbb{R^2} | (x-n)^2+y^2 \leq \frac{1}{9}\}\quad$ (i.e closed ball around $(n,0)$ with radius $\frac{1}{3}$).
Let $C :=\{(x,y) \in \mathbb{R^2} | y\leq -1\}$
(a) Prove that there exists a function $f : \mathbb{R^2}\rightarrow \mathbb{R}$ such that $f(x,y)=n$ for each $(x,y) \in B_n$ and $f(x,y)=0$ for each $(x,y) \in C$.
(b) Can $f$ be extended to a continuous function on the one-point compactification $\mathbb{R}\cup \{\infty\} $?
For (a) I have tried using Urysohn by observing that, for each $n \in \mathbb{N}$ there is a continuous function $f_n : \mathbb{R^2} \rightarrow [0,1]$ with $f_n|_{B_n} = 1$ and $f_n|_{C} = 0$ and then combining them somehow into a series that yields the desired function (I played around with this idea and the value $1$, even considering the unions of finite closed sets out of $\{B_n\}_{n\in \mathbb{N}}$ and $C$, but this doesn't seem to be going anywhere (in particular, I cannot get it to be $n$ on $B_n$, and/or to converge at all).
I then took a look at Tietze's extension proof again for inspiration, since I realized my attempts at using Urysohn didn't utilize some of the information (the radius and other values), and the Tieze proof uses similar values, but I'm not sure now that this is too relevant.
For (b), if the function discovered is such that it is defined on a closed set in this new space, then we can use Tietze to claim that there is such an extension. Otherwise I'm also not too sure what to do here.
Any advice?