Proving the differentiability. 
Prove that the function
$$f(x) = \begin{cases}  x^2 \quad \text{if $x$ is rational}\\ 0 \quad \text{if $x$ is irrational} \end{cases}$$is differentiable at $x=0$.

For differentiability the following limit
$$\lim_{h \to 0}\frac{f(0+h)-f(0)}{h}$$ should must exist.
Now proving that the above limit is $0$.
As $f(0)=0$, solving the inequality $|\frac{f(h)}{h}|<\epsilon$, we get for all rational $h$ we have to find a $\delta$ such that whenever $|h|<\delta$, $|\frac{f(h)}{h}|=|h|<\epsilon$. So if we choose $\delta=\epsilon$, then we are done. Now for all irrational $x$ we have to find a $\delta$ such that whenever $|h|<\delta$, $|\frac{f(h)}{h}|=0<\epsilon$ which is always true for every $\delta$. So again we are done and the limit exists. So the above given function is differentiable at $x=0$.
Am i right ?
 A: As mentioned in the comments, the idea of your proof is correct, but you need to phrase it properly. Here's how I'd present an answer (some steps are super obvious but I included them for the sake of being explicit):

Let $\varepsilon > 0$ be arbitrary. Choose $\delta = \varepsilon$, and let $h$ be an arbitrary real number satisfying $0 < |h| < \delta$. Then, we have two cases to consider.
Case 1: $h$ is rational.
Then, we have that
  \begin{align}
\left| \dfrac{f(0+h) - f(0)}{h} - 0 \right| &= \left| \dfrac{h^2 - 0^2}{h} - 0 \right| \\
&= |h| \\
&< \delta \tag{by assumption} \\
&= \varepsilon.
\end{align}
Case 2: $h$ is irrational.
In this case, we have
  \begin{align}
\left| \dfrac{f(0+h) - f(0)}{h} - 0 \right| &= \left| \dfrac{0 - 0^2}{h} - 0 \right| \\
&= 0 \\
&< \varepsilon.
\end{align}
  Since $\varepsilon > 0$ was arbitrary, this completes the proof that $f$ is differentiable at $0$, and $f'(0) = 0$.

To prove $f'(0) = 0$, we have to show that:

For every $\varepsilon > 0$, there exists a $\delta > 0$ such that for every $h \in \text{domain}(f)$, if $0 < |h| < \delta$, then
  \begin{equation}
\left| \dfrac{f(0+h) - f(0)}{h} - 0 \right| < \varepsilon.
\end{equation}

The reason why the answer I presented can be considered precise is because each sentence/phrase addresses a specific part of the quantifiers in the above statment. What I mean is we have to prove that "for every $\varepsilon > 0$ ..." so I started my proof with "let $\varepsilon > 0$ be arbitrary". Next, we have to show that "there exists a $\delta > 0$ ...", so I said "choose $\delta = ...$". Hopefully you get the idea. Whenever you're supposed to prove a "for all" or "there exists" statement, the wording of your proof should reflect that you understand what is required. 
This is a very basic almost "pattern-matching" type of way to see if atleast the structure of your proof is correct.
