Derivative of a continuous function. Let $g:R\to R$ be a continuous function with $g(x+y)=g(x)+g(y), \forall x,y\in R.$ Find $\frac{dg}{dx},$ if it exist.
 A: First what does $g(0)$ equal?
Second,
$$\frac{g(x+h) - g(x)}{h} = \frac{g(x) + g(h) - g(x)}{h} = \frac{g(h)}{h}$$
So what can you conclude about the derivative of $g$ in general?
A: Hint: Prove that $g(x) = rx, \forall x \in \mathbb{R} $ where $g(1) := r \in \mathbb{R}.$
EDIT1: Let $g(1) = r.$ Then $g(n) = g(1 + 1 + \cdots + 1)= g(1) + g(1) + \cdots + g(1) = ng(1) = nr, \forall n \in \mathbb N.$ Also $g(0) = 2g(0) \Rightarrow g(0) = 0 \Rightarrow g(0) = g(n - n) = g(n) + g(-n) \Rightarrow g(-n) = - g(n), \forall n \in \mathbb N.$ Thus $g(n) = nr, \forall n \in \mathbb Z.$ Also for any $n \in \mathbb Z, n\neq 0,  r = g(1) = g(n. \frac{1}{n}) = n g(\frac{1}{n}),$ showing that $g(\frac{1}{n}) =  \frac{r}{n}.$ From this we can conclude that $g(\frac{m}{n}) = r \cdot \frac{m}{n}, \forall m, n \in \mathbb Z, n \neq 0.$ Now use continuity to conclude that $g(x) = rx, \forall x \in \mathbb R.$
EDIT2: Let $f : \mathbb R \to \mathbb R$ be a continuous function such that $f(x) = 0, \forall x \in \mathbb Q.$ Take $\alpha \in \mathbb R \setminus \mathbb Q.$ Choose a sequence $(x_n)$ of rationals such that $x_n \to \alpha.$ Then by continuity, $f(x_n) \to f(\alpha).$ But $f(x_n) = 0, \forall n \in \mathbb N.$ So $f(\alpha) = 0.$ This is true for every $\alpha \in \mathbb R \setminus \mathbb Q.$ Hence $f(x) = 0, \forall x \in  \mathbb R.$ (In the above context, take $f := g(x) -  rx.$)
A: First we have $g(0) = 2g(0)\to g(0)=0$. Then it follows that
$$g'(x) = \lim_{y\to 0}\frac{g(x+y)-g(x)}{y} = \lim_{y\to 0}\frac{g(y)}{y} = \lim_{y\to 0}\frac{g(y)-g(0)}{y} = g'(0)$$
As noted below in the comments, this only shows that if $g'(x)$ exist for one $x$ then it exist for all $x$ and is indeed a constant.
