If a map $f$ is Lipschitz, then it is a standard result in dimension theory that $\dim_H f(Z) \leq \dim_H Z$ for all $Z$. More generally, if a map $f$ is Hölder with exponent $\alpha \in (0,1]$, then one has the inequality
$$
\dim_H f(Z) \leq \frac 1\alpha \dim_H Z. \qquad \qquad (*)
$$
The proof of this uses the same sorts of calculations as in Anton's answer. Now the function $f$ that you describe has the property that there is a Cantor set $C$ such that $f$ is locally constant on the complement of $C$. The complement of $C$ is open, and hence is a countable union of open intervals, so its image under $f$ is a countable set.

In particular, this implies that $f(C)$ is the entire interval $[0,1]$ with an at most countable set removed. Thus $\dim_H f(C) = 1$, and if $f$ were Hölder continuous with exponent $\alpha>0$, the inequality in (*) would give
$$
1 = \dim_H f(C) \leq \frac 1\alpha \dim_H Z = 0,
$$
a contradiction.