I have seen the definition for a simple function, $\phi:X \to \mathbb{R}$ where $$\phi(x) = \sum_{i=1}^k c_i \chi_{A_i}(x)$$
This seems silly in my head but I was wondering if we could have for example a simple function such as $$\phi(n) = \sum_{n=1}^k \sqrt{n}\chi_{ \{n\}}(n) $$
This doesn't seem like it should be allowed since the coefficients aren't constants, but they are constant on the sets $\{n\}$.
Note that in the expression $$\sum_{n=1}^k \sqrt{n}\chi_{ \{n\}}(n),$$ $n$ does not occur as a free variable. Therefore, upon fixing the parameter $k$, this becomes a constant (namely, $\sqrt 1+\sqrt 2+\ldots+\sqrt k$), not dependent on $n$ at all.
In particular, (having fixed $k$), the formula $\phi(n) = \sum_{n=1}^k \sqrt{n}\chi_{ \{n\}}(n)$ does define a simple function, just not a very interesting one.
It is not a constant, nor a simple function, when considered as a function of $k$, since there are infinitely many possible values.
Note that while the equation $\phi(n) = \sum_{n=1}^k \sqrt{n}\chi_{ \{n\}}(n)$ is formally correct, it is misleading, since $n$ is a free variable on the left hand side and it has no free occurences in the right hand side.
For a very similar example of this phenomenon in logic, consider the formula $$ \varphi(x)=(x^2>1 \rightarrow \exists x(x^2<1)), $$ or even just $$ \psi(x)=\exists x(x^2<1) $$ both of which are true for all real $x$, even those whose squares happen to be greater than $1$.
All of these examples are formally sound, but are considered bad form (precisely because they might cause confusion just like yours).
Finally observe that the related expression, $$ \sum_{m=1}^k \sqrt{m}\chi_{ \{m\}}(n), $$ does define (after fixing the parameter $k$) a simple function of the variable $n$. (which is zero for arguments outside of $\{1,2,\ldots, k\}$).