Every local property for $\mathbb{R}$ (any Connected Separable Space) holds globally? I'm given this problem :

  
*
  
*Prove that "being polynomial" is a local property, meaning if $f: ℝ → ℝ$ is a polynomial in a neighborhood of each real point, then $f$ is a polynomial.
  

I think I have proved a more general proposition, but I need verification of my proof !

Conjecture: For any Separable Connected Topological space $(X,\tau)$, every local property $\phi(f)$ for some function $f:X\rightarrow Y$, holds entirely over $X$.

my proof :
For each $x\in X$ define $U_x$ as follows :
$\displaystyle U_x:=\bigcup_{\substack{x\in U'_x\in\tau \\ \; U'_x\text{has property}\phi}}U'_x \quad$ $\bigg($*It's the Maximal Open Set Containing $x$ $\underline{\text{with property $\phi$}}$(??)*$\bigg)$

Lemma. $\forall x,y\in X :\;U_x=U_y\;\vee\;U_x\cap U_y=\emptyset$.
proof. If there's $z\in X$ that $z\in U_x\cap U_y$, then since $z\in U_x\in\tau$, so $U_x\subseteq U_z$.
Since $U_z$ is a suitable open set containing $x$ and $U_x$ is maximal, therefore $U_z\subseteq U_x$. $\quad\triangledown$

Corollary. $\{U_x\}_{x\in X}$ is a partition for $X$.

Let $A$ be the countable dense subset of $X$. Then by Axiom of Choice, there exists the sequence $\{q_n\}_{n\in\mathbb{N}}\subseteq A$, such that 
$\{U_{q_n}\}_{n\in\mathbb{N}}$ is a disjoint partition for $X$.

Claim. $\forall n:\; U_{q_n}=X$.
proof. Suppose $U_{q_n}\subsetneqq X$. Since $X$ is connected, $U_{q_n}\subsetneqq\overline{U_{q_n}}$. Let $y\in\overline{U_{q_n}}\setminus U_{q_n}$. Then there exists $m$ such that $y\in U_{q_m}$.
Now as $y$ is an interior point of $U_{q_m}$, so there is an open subset of $U_{q_m}$ around $y$. BUT each neighborhood of $y$ has nonempty intersection with $U_{q_n}$. Hence $U_{q_n}\bigcap U_{q_m}\neq\emptyset.\quad$($\bot$)


Theorem. Above conjecture is TRUE !????

 A: I have a feeling there is some rigor missing in your definition of property. There are certainly "properties" which hold locally (for every sufficiently small neighborhood of $x$ but not globally. A very easy example is being bounded. I.e. $\phi(f) \iff \exists m,n\in \mathbb{R}\;\forall x (n<f(x)<m)$. For every $x$ there exists a neighborhood such that $\phi(f)$ holds for $f(x)=x$. But obviously $\phi(f)$ does not hold on $\mathbb{R}$.
You might be able to fix this if you maybe require $\phi(x)$ has no existential quantifiers or something similar. But maybe I'm misunderstanding something. This particular counter example can also be fixed by also requiring your space to be compact.
Edit: One last thought on your proof. You can see where it breaks down for the counterexample I gave. There is no maximal open set for which $\phi(f)$ holds.
A: The problem of your proof is that you've never shown that $U_x$ has property $\phi$. (It is just a union of open sets which has property $\phi$). So even if you showed $U_{q_n} = X$, you still do not know whether property $\phi$ holds on $U_{q_n}$ (Hence $X$). 
Your assertion is indeed false. Take $X = \mathbb R^2 \setminus \{0\}$ and $\phi$ be a property on open subsets of $X$ given by 
"$f$ has property $\phi$ on $U$ if $f : U \to \mathbb S^1$ is homotopic to a constant map"
Then consider $f :  X \to \mathbb S^1$, $f(r, \theta) = \theta$. Then $f$ has property $\phi$ locally for all $x\in X$, but $f$ does not have property $\phi$ on $X$.  
