There is a piecewise function $f$ defined as following:
$$f:\left\{\begin{matrix} \frac{1-\cos(x)}{x} \Leftarrow x\neq0\\ 0 \Leftarrow x=0 \end{matrix}\right.$$
I'm asked to first show that $f$ is continuous at $0$, then show that $f$ is derivable at $0$, and finally calculate $f'(0)$.
I know that $g(x)$ is continuous at $x_{0}$ if $\lim_{x\rightarrow x_{0}}g(x)=g(x_{0})$ and derivable at $x_{0}$ if $\lim_{x\rightarrow x_{0}}\frac{g(x)-g(x_{0})}{x-x_{0}}=g'(x_{0})$ exists.
Here's what I have done to demonstrate that $f$ is continuous at $0$:
$$\lim_{x\rightarrow 0}\frac{1-\cos(x)}{x}=\lim_{x\rightarrow 0}-\frac{\cos(x)-\cos(0)}{x-0}=-\lim_{x\rightarrow 0}\frac{\cos(x)-\cos(0)}{x-0}=-\cos'(0)=\sin(0)=0=f(0)$$
Then, I was confused when I saw the following question that asked me to show that $f$ is derivable at $0$, as that property was how I solved the first question.
I think that there should be some another way to demonstrate how $f$ is continuous at $0$ which I don't realize, or it could be that I'm misusing the conditions of continuity and derivability at a point.
Anyways, any help would be appreciated and thank you for your time.
You did well for establishing continuity at $0$.
Every time a function $g$ (defined over an open interval $(a,b)$, for simplicity) is differentiable at a point $x_0\in(a,b)$, the function $$ f(x)=\begin{cases} \dfrac{g(x)-g(x_0)}{x-x_0} & \text{if $x\in(a,b)$, $x\ne x_0$} \\[6px] g'(x_0) & \text{if $x=x_0$} \end{cases} $$ is continuous at $x_0$, by definition of derivative and of limit. In your case, $g(x)=-\cos x$, $x_0=0$ and $g'(0)=\sin 0=0$.
For differentiability at $x_0$ you can apply the definition: $$ f'(x_0)=\lim_{x\to x_0}\frac{f(x)-f(x_0)}{x-x_0} $$ if the limit exists and is finite. In your case, $$ \lim_{x\to0}\frac{\dfrac{1-\cos x}{x}-0}{x}= \lim_{x\to0}\frac{1-\cos x}{x^2}= \lim_{x\to0}\frac{1-\cos^2x}{x^2}\frac{1}{1+\cos x}= \frac{1}{2} $$ The first factor in the final limit is $$ \left(\frac{\sin x}{x}\right)^2 $$