Canonical: https://knowlpedia.com/real-analysis/step-function/

# Step function

A function that is constant on each subinterval of some partition.

A **step function** on \([a,b]\) is a [function](https://knowlpedia.com/shared-foundations/function/) \(s:[a,b]\to\mathbb R\) for which there exists a [partition](https://knowlpedia.com/real-analysis/partition-of-an-interval/) \(P=\{x_0,\dots,x_n\}\) and constants \(c_1,\dots,c_n\) such that
\[
s(x)=c_i \quad \text{for all } x\in(x_{i-1},x_i),\ i=1,\dots,n.
\]
The values of \(s\) at the partition points \(x_i\) can be chosen arbitrarily without changing this property.

## Remarks

Step functions are basic building blocks in the theory of the [Riemann integral](https://knowlpedia.com/real-analysis/riemann-integral/); in particular, they are [Riemann integrable](https://knowlpedia.com/real-analysis/riemann-integrable-function/) and play a role analogous to a [simple function](https://knowlpedia.com/measure-theory/simple-function/) in measure theory.

## Examples

- Any constant function \(s(x)=c\) on \([a,b]\) is a step function (take \(P=\{a,b\}\)).
- On \([-1,1]\), the function \(s(x)=0\) for \(x<0\) and \(s(x)=1\) for \(x>0\) is a step function (take \(P=\{-1,0,1\}\)).
