Intereting Posts

Calculating $\lim_{x\to0} \left\lfloor\frac{x^2}{\sin x \tan x}\right\rfloor$
Can locally “a.e. constant” function on a connected subset $U$ of $\mathbb{R}^n$ be constant a.e. in $U$?
Bounded inverse operator
Odds of anyone in a group getting picked twice in a row
Difficulty in evaluating a limit: $\lim_{x \to \infty} \frac{e^x}{\left(1+\frac{1}{x}\right)^{x^2}}$
Manipulation of Bell Polynomials
Is it possible to determine if you were on a Möbius strip?
Basic understanding of Spec$(\mathbb Z)$
Is $\tan(\pi/2)$ undefined or infinity?
Is $W_0^{1,p}(\Omega)$ complemented in $W^{1,p}(\Omega)$?
Roots of a equation on a complex plane
Proving convergence of $\sum \frac{\sin n}{2^n}$
Explaining the product of two ideals
How many ways are there to choose 5 ice cream cones if there are 10 flavors?
Group of order $pqr$, $p < q < r$ primes

Suppose $X$ is a non-compact metric space. Show that there exists a continuous function $f: X \rightarrow \mathbb{R}$ such that $f$ does not achieve a maximum.

I proved this assertion as follows:

If $X$ is non-compact, there exists a sequence which has no converging subsequence. Therefore, the set $E$ of elements of this sequence is infinite and has no limit points. Therefore, in the induced topology, $E$ is a countable discrete space. Let $e_n$ be a enumeration of $E$. Define $f: E \rightarrow \mathbb{R}$ as $f(e_n)=n$. Since $E$ is discrete, $f$ is continuous. By Tietze (note that $E$ is closed in $X$), there exists a continuous function $g: X \rightarrow \mathbb{R}$ which extends $f$. But $f$ is unbounded, then so is $g$, and $g$ does not achieve a maximum. $\square$

- An open subset $U\subseteq R^n$ is the countable union of increasing compact sets.
- Is a compact simplicial complex necessarily finite?
- Metrizability of a compact Hausdorff space whose diagonal is a zero set
- Compact metrizable space has a countable basis (Munkres Topology)
- Proving the inverse of a continuous function is also continuous
- How to prove a topologic space $X$ induced by a metric is compact if and only if it's sequentially compact?

My first question is: Is everything in the proof fine?

Now, my second question is: Can you provide me a proof which is more elementary? (Not using Tietze, for example. This exercise is just after the definition of compactness. I suppose this proof is not what was intended.)

And my third question is: Does the proposition hold for arbitrary topological spaces? If not, can you provide a counter-example?

- Pullback of a covering map
- Why not just study the consequences of Hausdorff axiom? What do statements like, “The arbitrary union of open sets is open,” gain us?
- Density of $e^{in \alpha}$
- intuition on the fundamental group of $S^1$
- Products of Continuous functions: Topology
- A shrinking map that is not a contraction no fixed point.
- Proving that every countable metric space is disconnected?
- Cluster Point in Fréchet-Urysohn Space is Limit Point?
- Cartesian product of dense sets is dense?
- Tychonoff theorem (1/2)

Your argument is correct and is probably the most straightforward. The result does not even hold in all $T_3$ spaces: in this answer I give a general method, due to Eric van Douwen, for starting with a $T_3$ space having two points that cannot be separated by a continuous real-valued function and producing from it a $T_3$ space on which all continuous real-valued functions are constant. The other answer to that question gives references to two $T_3$ spaces having two points that cannot be separated by a continuous real-valued function, and this answer expands on one of those spaces and gives yet another example of such a space.

The proof seems fine but Tietze needs to have the function continuous on a closed subset, but as it has no limit points this is given. If your function Needs to be continuous I can tell you the third question to have a negative answer.

In fact there is a non compact Hausdorff space such that the continuous functions are exactly the constant ones. Take $\mathbb{Z}^+$ with the relatively prime integer topology, here it is the case that for every non empty open sets $U,V$ the intersection $\overline{U}\cap \overline{V}\neq \varnothing$ hence every continuous function to $\mathbb{R}$ must be constant and so surely attains a Maximum.

To see it is not compact is a bit more difficult, here you use that if it is compact it needs to be $T_3$ and $T_4$ (as it is Hausdorff), but with $T_4$ we would have Urysohn-Lemma which grants you more continuous mappings.

Here is an explicit and elementary construction, using only the fact that a metric space is compact iff every sequence has an accumulation point. Let $(x_n)$ be a sequence in $X$ with no accumulation point, and define $g(x)=\inf_n d(x,x_n)+1/n$ and $f(x)=1/g(x)$. It is easy to see that $g(x)=0$ iff $x$ is an accumulation point of $(x_n)$, so $g$ is never $0$ and $f$ is defined on all of $X$. Moreover, $f(x_n)\geq n$, so $f$ is unbounded. Finally, it is straightforward to check that $g$ is continuous, and hence so is $f$.

- Limit of sequence of continued fractions
- Show that $(1+p/n)^n$ is a Cauchy sequence for arbitrary $p$
- Construct tangent to a circle
- Does $\sum _{k=2} ^\infty \frac{(-1)^k}{\sqrt{k}+(-1)^k}$ converge conditionally?
- Intuitionistic proof of $\neg\neg(\neg\neg P \rightarrow P)$
- Why is F a UFD?
- Classification of prime ideals of $\mathbb{Z}$
- Do there exist closed subspaces $X$, $Y$ of Banach space, such that $X+Y$ is not closed?
- How to write $\aleph$ by hand
- Explanation of proof of Gödel's Second Incompleteness Theorem
- Fixed sum of combinations
- When can we not treat differentials as fractions? And when is it perfectly OK?
- Real analyticity of a function
- Why are Dedekind-finite rings called so?
- Show that $({\sqrt{2}\!+\!1})^{1/n} \!+ ({\sqrt{2}\!-\!1})^{1/n}\!\not\in\mathbb Q$