# How to show a compact sets has finite measure?

This is a step used in proving Riesz representation theorem. However I cannot follow his short proof. For every compact set $K$, he construct an $f\in C_{c}(X)$ such that $0\le f\le 1$, and $f(x)=1,x\in K$. This is fine. But then in the end he claim $\int_{X}2fd\mu<\infty$. This means we need to show $$\int_{X}fd\mu<\infty$$ But why this is true? $f$ can really be any function. So more specific if $X=\mathbb{R}^{*}$, $K=[0,1]$, $x=1$ on $K$ and as $x-2$ outside of $K$, then $f$ is definitely not in $L_{1}(X)$. I think I must be confused with something somewhere.

A proof clearly borrowed from his book can be found at here, page 77, Step 3.

-
I have written a proof for Riesz representation Theorem, two months ago when I teahing Real analysis 1 problem solving that there I explore it in 10 pages in details, but it is in persian, can you read persian? to I send it for you. – AmirHosein SadeghiManesh Dec 23 '12 at 11:00
You are wrong because you didn't pay attention to definition of your measure by this theorem. – AmirHosein SadeghiManesh Dec 23 '12 at 11:03
that function you definef is not continuos too, so it is not in $C_{C}(X)$. – AmirHosein SadeghiManesh Dec 23 '12 at 11:05
I see where I wrote become nonsense. The function is supposed to have compact support. But here is the problem - why integrating a function with compact support must yield a finite number? Consider $\frac{1}{x}$, for example. – Bombyx mori Dec 23 '12 at 11:10
So at the time we prove that the integral...., we have a measure there! – AmirHosein SadeghiManesh Dec 23 '12 at 11:27