This paper highlights an unexpected connection between expansions of real numbers to noninteger bases (so-called beta-expansions) and the infinite derivatives of a class of self-affine functions. Precisely, we extend Okamoto's function (itself a generalization of the well-known functions of Perkins and Katsuura) to a two-parameter family {F-N,F-a : N is an element of N, 1/(N + 1) < a < 1}. We first show that for each x, F-N,F-a '(x) is either 0, +/-infinity, or undefined. We then extend Okamoto's theorem by proving that for each N, depending on the value of a relative to a pair of thresholds, the set {x : F-N,F-a '(x) = 0} is either empty, uncountable but Lebesgue null, or of full Lebesgue measure. We compute its Hausdorff dimension in the second case. The second result is a characterization of the set D-infinity (a) := {x : F-N,F-a '(x) = +/-infinity}, which enables us to closely relate this set to the set of points which have a unique expansion in the (typically noninteger) base beta = 1/a. Recent advances in the theory of beta-expansions are then used to determine the cardinality and Hausdorff dimension of D-infinity(a), which depend qualitatively on the value of a relative to a second pair of thresholds. (C) 2017 Elsevier Inc. All rights reserved.