A few months ago, while attempting to create a parameterization of the Hilbert curve, I discovered an interesting function, given by the summation...
$$f(x)=\sum_{n=1}^\infty \frac{\text{sgn}\left(\cos(nx)\right)}{n}$$
...where $\text{sgn}$ is the signum function...
$$\text{sgn}(x)=\begin{cases}1&x>0\\0&x=0\\-1&x<0\end{cases}$$
The function is noteworthy for being nowhere differentiable and nowhere continuous. I have found it nigh impossible to evaluate the function for any $x$ save integer multiples of $2\pi$ (where the sum diverges).
The graph of the function (shown below) seems to be a self-similar fractal, but I don't know enough about fractals to verify this. Even if I did, I'm not sure what I would do with this information.
Anyway, how can I find the value of $f(x)$ for arbitrary $x$?


For rational multiples of $\pi$, $\text{sgn}(\cos(nx))$ is periodic and the sum can be done in "closed form" in terms of the Digamma function. Thus for $x = 3\pi/4$, Maple tells me:
$$ \frac{\pi}{4} - \frac{\ln(2)}{4} + \frac{\Psi(1/8) - \Psi(3/8)}{4} $$