The function $f(x)=\frac{1-\cos x}{x}$ is to be evaluated at $x\approx 0$.
a) Calculate the condition number of $f$ at $x$ and thus find out whether $f$ is well-conditioned or not.
b) Write $f$ in such a way that loss of significance doesn't occur at $x\approx 0$.
My problem is that $f$ is not defined at $x=0$, so $$ \kappa_f(x) = \left|\frac{x f'(x)}{f(x)}\right| = \frac{(\frac{1-\cos x}{x})'\cdot x}{\frac{1-\cos x}{x}}$$ is not defined at $x=0$. While it's true that $f$ is to be evaluated at $x\approx 0$, I still don't know how that can help me with this problem.
There remains a few issues which have not be addressed by the previous answer or the comments.
Specifically, the condition number $\kappa_f(x)$ is not defined for $x=0$ and we are not obligated to consider this point. The fact that $\kappa_f(x)$ can be extended continuously to $x=0$ is convenient, but irrelevant. As stated by @PierreCarre, we say that $f$ is well-conditioned near $x=0$ because $\kappa_f(x)$ is bounded in a neighborhood of $0$.
Moreover, the notation used to state the original problem is unfortunate. Specifically, the use of $x\approx 0$ is not appropriate when the intention is to indicate small, nonzero values of $x$. The correct notation is $0<|x|<\delta$ where $\delta \ll 1$. This is not fault of the OP, but an abuse of notation which is common.
There are many different types of conditions numbers. The condition number $\kappa_f(x)$ is the so-called (component-wise) relative condition number of $f$ at the point $x$. Here the objective is to measure the sensitivity of the relative error $\frac{f(x+\Delta x)-f(x)}{f(x)}$ to relatively small changes $\Delta x$ of the input $x$. This precludes the possibility of $f(x)=0$ and invites the restriction that $x \not = 0$.
The exact definition of the relative condition number is as follows. Let $\kappa_f(x,\epsilon)$ be given by $$\kappa_f(x,\epsilon) = \sup \left\{ \frac{1}{\epsilon}\frac{|f(x+\Delta x) - f(x)|}{|f(x)|} \: : \: |\Delta x| \leq \epsilon |x| \right\}.$$ This is a nonnegative and increasing function of $\epsilon$. It follows that $$ \kappa_f(x) = \underset{\epsilon \rightarrow 0_+}{\lim} \kappa_f(x,\epsilon)$$ exists. If $|\Delta x| \leq \epsilon |x|$, then by the definition of $\kappa_f(x,\epsilon)$ we have $$ \frac{|f(x+\Delta x)-f(x)|}{|f(x)|} \leq \epsilon \kappa_f(x,\epsilon) $$ and for sufficiently small values of $\epsilon$ we have $$\kappa_f(x,\epsilon) \approx \kappa_f(x).$$
As stated by @WimC and @Lutz Lehmann it is possible to rewrite the function $f$ to avoid subtractive cancellation. The rewrites are necessarily problem dependent and you need to build your own library of techniques. Another useful procedure is to obtain the Taylor expansion of $f$ directly. We have $$\cos(x) = 1 - \frac{1}{2}x^2 + \frac{1}{24}x^4 + O(x^6).$$ It follows that $$f(x) = \frac{1}{2}x - \frac{1}{24}x^3 + O(x^5).$$ We will not suffer from subtractive cancellation here because the terms have vastly different magnitude for small values of $x$. The downside of this procedure is that we are left with the question of determining how many terms to include in the Taylor expansion.