I came up with the following elementary theorem :
Given a group $(G,\circ)$, prove that every nonempty subset $H$ of $G$ is a subgroup.
For every element, $a \in H$ from the definition of subset follows $a \in G$, and since $G$ is a group hence there exists $1_G \in G$ such that $a1_G=a=1_Ga$$\;$, and I think $1_G=1_H$ does not necessarily hold.
For every $a \in H$ from the definition of subset follows $a \in G$,and since $G$ is a group hence there exists $a^{-1}\in G$ such that $aa^{-1}=1_G=a^{-1}a$.
For every $a,b,c \in H$ from the same reason follows $a,b,c \in G$ and since $G$ is a group,hence $a \circ ( b \circ c )=(a \circ b) \circ c $.
For every $a,b \in H$ again from the same reason $a,b \in G$ ,and since $G$ is a group hence $a \circ b \in G $.
From this work, I've concluded that not necessarily every subset $H$ of a group $G$ contains the inverse of the elements $\in H$, it's not true that $H$ does contain necessarily an identity element. In general, it's not true to say $H$ is closed under $\circ$, However, I think it's true to conclude that $\circ$ is necessarily associative for every nonempty subset $H$ of a group $(G,\circ)$.
I'm not sure how much of my conclusion is true, so it would be nice if someone confirms and explain the problems (if exists ).
Besides, it would be appreciated if someone gives me an example of a group that is closed under a binary operation, but there exists a subset of that group that is not closed under the same binary operation.
For any group $(G,\circ)$ with more than one element, if $g\in G\setminus\{1_G\}$ and if $H=\{g\}$, then $H$ is a nonempty subset of $G$ which is not a subgroup (since $g\circ g\ne g$).
But you are right when you say that, if $H$ is closed for the operation $\circ$, then $\circ$ is associative on $H$.