Is $P$ is homeomorphics to $Q$? yes/NO Is  $P$ is  homeomorphics  to $Q$?
$P=\{(x,y)\in \mathbb{R^2}:y=\sin (\frac{1}{x}),0<x\le 1\}\cup \{(x,y)\in \mathbb{R^2}:,x=0,-1\le y\le 1\}$
$Q=[0,1] \subseteq \mathbb{R}$.
My attempt :   i know  that P is topologist  sine curve  it is  compact and connected  and $[0,1] $ is  also compact and connected by heine borel theorem
i thinks  both P and Q are  homoeomorphics
is my logics  is correct/not correct?
any hints/solution will be appreciated
thanks u
 A: As an easy way to see that your reasoning is not correct, note that any subset of $\mathbb{R}$ containing exactly one point is compact and connected, but is not homeomorphic to the interval $[0,1]$.

As regards $P,Q$, note that if you remove the $3$ points 
$$(0,1),\;\;(0,-1),\;\;(1,\sin(1))$$
from $P$, the remaining set $S$ is still connected.

But if you remove any $3$ distinct points from $[0,1]$, the remaining set is disconnected.

If $f:P\to Q$ was a homeomorphism, the restriction of $f$ to $S$ would be a homeomorphism from $S$ to $f(S)$. But then, since $f(S)$ is equal to $[0,1]$ with $3$ points missing, $f(S)$ is not connected, contradiction. 

It follows that $P,Q$ are not homeomorphic.

Here's another way to see it . . .

Since the removal of any of the $3$ points
$$(0,1),\;\;(0,-1),\;\;(1,\sin(1))$$ 
doesn't disconnect $P$, a homeomorphism $f:P\to Q$ would have to map each of those $3$ points to either $0$ or $1$, but then the pigeonhole principle would imply that $f$ is not injective, contradiction.
A: Your logic is not correct. You do not have enough to assert that your $P$ and $Q$ are homeomorphic. You are essentially guessing (I do not mean this in a bad way).
HINT:
Path-connectedness is invariant under homeomorphism. That is to say, if a path connected space $X$ is homeomorphic to $Y$, then $Y$ has to be path-connected too.
