1: let $X$ be a Hausdorff topological Space , $Y \subseteq X $ is Nonempty and dense in $X$. let $f: X \longrightarrow X $ be a continuous functions so that $ \forall y \in Y, f(y) = y $.
Is $f$ a identical function?
My second question is:
2: Let $A$ be a connected subset of the topological space $X$and $Y \subseteq X $.
Can we say if $A \bigcap Y \neq \emptyset$ and $A \bigcap Y^{c}\neq \emptyset$, then $ A \bigcap \partial Y \neq \emptyset $? Why?
I don't know what you mean by "Nonsense", but $\{x\in X: f(x)=x\}$ is closed in $X$, so if it is dense it must be the whole space.