We construct the new function as follows, given
p
∈
X
then we define
g
(
p
)
=
f
(
p
)
, otherwise
p
∉
X
, note that since
X
is compact it's closed so that
X
C
is open, since
p
∈
X
C
then we know that there exists some
ϵ
∈
R
+
such that
B
(
x
,
ϵ
)
⊆
X
C
Now define
L
=
{
x
∈
X
:
x
<
p
}
and
R
=
{
x
∈
X
:
x
>
p
}
. If both
L
=
R
=
∅
then
X
=
{
p
}
and so since we assumed
p
∉
X
that would be a contradiction, so instead one of these must be non-empty, assume that
L
≠
∅
, we claim that
L
=
X
∩
(
−
∞
,
p
−
ϵ
]
, this is the case because for any element
s
∈
B
(
p
,
ϵ
)
it's true that
s
∉
L
, but also we do know that
p
−
ϵ
∈
X
, therefore
L
is the intersection of two closed sets and therefore closed.
Since
L
is closed then
sup
(
L
)
∈
L
, if it's the case that
R
=
∅
then we linearly interpolate from
f
(
sup
(
L
)
)
to
0
over
[
sup
(
L
)
,
N
]
, otherwise
R
≠
∅
and we linearly interpolate from
f
(
sup
(
L
)
)
to
f
(
inf
(
R
)
)
over
x
∈
[
sup
(
L
)
,
inf
(
R
)
]
. Note that by doing this it maintains the sup norm.
The function is continuous as it's a piecewise continuous and at each connection point they are continouous as the left and right limits are equal. Thus
g
is a continuous extension of
f
on
[
−
N
,
N
]
, due to this we can apply WAT to
g
to obtain a sequence of polynomials whose limit is
g
, then by restriction the domain of the polynomails to
X
then these "new" ones go to
f
.