I'm trying to write more formal proofs for rather obvious/intuitive things. I wanted to know whether my proof for this question is good enough.
Prove that the closure of the set $(a,b)$ is the set [$a,b$].
From a well known property we know that $Cl(A)=A \cup \operatorname{acc}(A)$
Then it is enough to prove that $a$ and $b$ are accumulation points of $(a,b)$.
I will be using the following definition for accumulation point :
$x$ is an accumulation point of the set A if $B(x,r)\cap(A \setminus \{x\}) \neq \varnothing \ \forall r>0$.
Now to check whether $a$ and $b$ are accumulation points we need to check if there exists $r>0$ such that $B(a,r)\cap ((a,b) \setminus \{a\}) = \varnothing$.
$B(a,r)=(a-r,a+r)$
It is obvious that we can always find a point such that belongs in the second half of the interval that is $x \in (a,a+r)$ and also belongs in $(a,b) \setminus \{a\}$.
So indeed $a \in \operatorname{acc}((a,b))$.
Similarly $B(b,r)=(b-r,b+r)$ and there exists point $x$ that belongs in the first half of the interval and also belongs in $(a,b) \setminus \{b\}$
So these two points are indeed accumulation points. It follows that $Cl((a,b))= [a,b]$
Is this solution correct? Also is there perhaps a simpler approach ?
EDIT: After reading through the answers I realized that we also need to prove that there are no other accumulation points outside the interval $(a,b)$. This can be done by picking suitable radius. There were couple of them suggested in comments/answers.
Your proof is correct so far as it goes, but it is incomplete. You also need to show that if $x \not\in [a,b]$ then $x$ is not an accumulation point of $(a,b)$. This is reasonably straight-forward:
If $x < a$ then fix $r < \frac{1}{2}(a-x)$. Then $B(x,r) \cap (a,b) = \emptyset$. The case when $x > b$ can be handled similarly by taking $r < \frac{1}{2}(x-b)$.
Also, since you are stating that $\operatorname{cl}(A) = \operatorname{acc}(A) \cup A$, it might be good to make sure that you are accurately describing the set of accumulation points. In your proof, you leave out everything in the interval $(a,b)$. This turns out not to really matter, since all of those points get thrown in when you take a union at the end, but it doesn't hurt to be careful.
Finally, since you are looking for feedback on your proof, I would suggest that you avoid terms like "obviously," "clearly," or "trivially." It is slightly condescending to say that something is obvious, and it doesn't really add anything to the exposition to assert that a claim is clear. If something is obvious, you don't need to tell the reader that it is obvious—trust them to understand (or explain in more detail). Don't waste the words. :)
Putting everything together, I might prove the claim as follows:
Proof: If $x \in (a,b)$ then $x \in B(x,r) \cap (a,b)$ for any $r > 0$. Therefore $x$ is an accumulation point of $(a,b)$.
If $r > 0$, then $a+\frac{r}{2} \in B(a,r)$ for any $r > 0$, hence $a$ is an accumulation point of $(a,b)$. Similarly, $b-\frac{r}{2} \in B(b,r)$ for any $r > 0$, and so $b$ is an accumulation point of $(a,b)$.
If $x < a$, fix some $r < \frac{1}{2}(a-x)$. Then $B(x,r) \cap (a,b) = \emptyset$. Thus $x$ is not an accumulation point of $(a,b)$ for any $x < a$. Similarly, if $x > b$, fix $r < \frac{1}{2}(x-b)$. Then $B(x,r) \cap (a,b) = \emptyset$. Thus $x$ is not an accumulation point of $(a,b)$ for any $x > b$.
Therefore $\operatorname{cl}((a,b)) = \operatorname{acc}((a,b)) \cup (a,b) = [a,b]$. $\tag*{$\blacksquare$}$