Let $A\subset \Bbb R^2 $ with the property that every continuous function on $A$ has a maximum in $A$ .Prove that $A$ is compact.
My try:
We have to show that $A$ is closed and bounded.
In order to prove this result we should have some ready continuous functions in our hand. The projection maps can be used.
Define $\pi_x:A\to \Bbb R ;\pi_x(x,y)=x$ and $\pi_y:A\to \Bbb R ;\pi_y(x,y)=y$
They attain their bounds on $A$ so there exists $(a,b)\in A$ such that $\sup_{\{(x,y)\in A\}}\pi _x(x,y)=a $ and $(a,b)\in A$ such that $\sup_{\{(x,y)\in A\}}\pi _y(x,y)=b$
I can't proceed further.Please help